I am using Apache/PHP/MySQL web server and I'm trying to load a grid. I followed the demo to get a working grid with my data, and I have an index.php page that simply includes the maininteractionsgrid.php (pasted below). Now I would like to be able to add a WHERE statement to the sql based on a variable that has already been assigned in the index.php. I can get the WHERE statement to work if I specify a fixed number (i.e. siteid=10), but for some reason it won't work if I specify the variable (i.e. siteid=$siteid… $siteid has already been set to 10). Can someone PLEASE help me figure out why my code below isn't working? I have tried searching all over online and can't find anything as to why my code isn't going through. All I would like to do is get only the records for a certain site based on a passed variable, $siteid. Any help would be greatly appreciated. Thanks.
require_once 'jqinteractionsconfig.php';
// include the jqGrid Class
require_once ABSPATH.”php/jqGrid.php”;
// include the driver class
require_once ABSPATH.”php/jqGridPdo.php”;
// Connection to the server
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query(“SET NAMES utf8”);
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$mysql = “SELECT InteractionID, InteractionDateTime, ContactID, ContactedBy,
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top