Hi
I got jqxGrid to bind to mysql database just fine. I have done the following changes to the data.php to see if I can get the same results from a Postgresql database.
Changes:
//include(‘connect.php’);
$connect = pgsql_connect(“host=localhost dbname=xxxx user=xxxxx password=xxxxx”) or die(‘Could not connect: ‘ . pg_last_error());
//select database
//mysql_select_db($database, $connect);
//Select The database
//$bool = mysql_select_db($database, $connect);
//if ($bool === False){
// print “can’t find $database”;
//}
// get data and store in a json array
$query = “SELECT firstname,lastname,dob,address1,city FROM customers”;
$from = 0;
$to = 30;
//$query .= ” LIMIT “.$from.”,”.$to;
$query .= ” LIMIT “.$to;
$result = pg_query($query);
while ($row = pg_fetch_array($result, null, PGSQL_ASSOC)) {
$customers[] = array(
‘CompanyName’ => $row[‘firstname’],
‘ContactName’ => $row[‘lastname’],
‘ContactTitle’ => $row[‘dob’],
‘Address’ => $row[‘address1’],
‘City’ => $row[‘city’]
);
}
As far as I can tell this should connect and bring back the results, but it show “no data to display”
Am I missing something. I would appreciate some help.
Regards