The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add UserSpice to CRUD or vice versa
#1
Hi, thanks for UserSpice, I can apply Php easily - I'm not yet good at Php.
How do I add UserSpice to a CRUD application?
I have a [MySql] table I have already linked several CRUD pages to; I'm thinking I haven't got them to work well with the UserSpice classes.
To start with, I have the following Php in the read.php CRUD page I need help with:

<?php
// require 'database.php';
$id = null;
if ( !empty($_GET['id'])) {
$id = $_REQUEST['id'];
}

if ( null==$id ) {
header("Location: index.php");
} else {
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // I haven't appreciated much what this one does.
$sql = "SELECT * FROM bylaws where id = ?";
$q = $pdo->prepare($sql);
$q->execute(array($id));
$data = $q->fetch(PDO::FETCH_ASSOC);
DB::disconnect();
}
?>
  Reply


Messages In This Thread
Add UserSpice to CRUD or vice versa - by PaulM - 12-12-2017, 11:45 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)