Hello,
I’m working through some examples in the PHP Anthology from Sitepoint, with the examples slightly modified for my purposes. In this case, I am trying to query a database and display the info in a data grid using various PEAR modules (Structured_DataGrid and company) as per the example. A couple of the modules are still beta, so I had to change the preferences for my PEAR installation (XAMPP on a thumb drive) accordingly to be able to install them at all.
Anywho, apparently there is an error somewhere early on in the first simple query of the info which is causing my data grid to not appear. The auth credentials for the db are the same ones I’ve used in working through the last few examples so I don’t think they are screwed up. The book code just returns a blank page with a header at top, and shunts the error messages to an error_log… which I have been unable to find, either on my drive or via the 'Net, which is a bit frustrating. If someone could take a look at this code and either tell me what is wrong with it or better yet, point me in the direction of this error log so I can see what the output was… that’d be awesome
<?php
// Include the DB access credentials
require 'dbcred.php';
// Include the PEAR Structures_DataGrid class
require 'Structures/DataGrid.php';
// instantiate grid for 2 records per page
$datagrid = new Structures_DataGrid(2);
// Define our Datasource options, in this case MDB2 MySQL
$options = array('dsn' => "mysql://$user:$password@$db_host/$db_name");
// Define the Query
$sql = "SELECT * FROM test";
// Bind the Query to our Datagrid
$bind = $datagrid->bind($sql, $options);
// Test for Errors
if (PEAR::isError($bind))
{
error_log('DataGrid Error: '. $bind->getMessage());
$gridsource = '';
}
else
{...