Lisa1983 Posted May 14, 2009 Share Posted May 14, 2009 Everything was working on the site until this morning - I made no changes, nor did my client. I am completly lost as to why it is coming up with - Fatal error: Call to a member function query() on a non-object in /lst_rcd.php on line 6 The following code is the list code: <?php require_once('./include/db_cnct.php');// begin reading the table to output results the the screen. $sql = 'SELECT * FROM branches ORDER BY date_entr'; if( !$rssrslt = $db->query($sql) ) { message_die(GENERAL_ERROR, "table read error", "",__LINE__, __FILE__, $sql); } while ($arr = $rssrslt->fetchrow()) { $row[]=$arr; } $max_elements = count($row); for ($i = 0; $i < $max_elements; $i++) { $blstng = ($row[$i]['branchname']); $el_line .= (($i+1).'.) '.$blstng.'<br/>'); } echo ('<div id="records"><p>'.$el_line.'</p></div>'); It needs to load the list not an rssfeed. It was working no changes made and now it errors out. THIS IS URGENT....Client needs fixed by 5/15/09. Thank you for your help. Link to comment https://forums.phpfreaks.com/topic/158181-help-with-sudden-fatal-error-call-to-a-member-function-query-on-a-non-object/ Share on other sites More sharing options...
Ken2k7 Posted May 14, 2009 Share Posted May 14, 2009 Assuming that's the entire script for lst_rcd.php, is $db defined in includes/db_cnct.php? Link to comment https://forums.phpfreaks.com/topic/158181-help-with-sudden-fatal-error-call-to-a-member-function-query-on-a-non-object/#findComment-834415 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.