here is the connection:
/*
Database Connection | Pear::DB API
--------------------------------------------------------------*/
$dsn = "mysql://$user:$pass@$host/$db_name";
$db = DB::connect($dsn);
if (DB::isError($db))
{
die ($db->getMessage());
}
here is the code:
/**
* Creates the header for the directory
*
* @param string $hostname
* @param string $view
* @param string $i
* @return string
*/
function top_nav($hostname,$view, $i)
{
$l = chr($i);
// Connect to the database so that
$s = "SELECT * FROM md_models WHERE alias REGEXP '^($l)'";
$q = $db->query($s);
if (DB::isError($result))
{
die ($result->getMessage());
}
$r = $q->fetchRow();
$v = $db->getOne($s);
// Print valid letters
if ($v!=0)
{
$letter = '<td width=20 align=center>
<a href="index.php?cmd=find&l='.$l.'&view='.$view.'"
style="color: black; text-decoration: none; font-weight: bold">'.$l.'</a>
</td>';
}
else
{
$letter = '<td width=20 align=center style="color: #CCCCCC; font-weight: bold">'.$l.'</td>';
}
return $letter;
}
This is the error:
Fatal error: Call to a member function on a non-object in /data1/members.scoreland/docs/cgi/secured/modeldir/lib/functions/functions.misc_utilities.php on line 77
Here is line 77:
$q = $db->query($s);
Does anyone have any clue what is causing the issue, its starting to annoy me.