Fatal Error: Call to Member

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stwallace
Forum Newbie
Posts: 3
Joined: Sat Oct 07, 2006 11:43 pm

Fatal Error: Call to Member

Post by stwallace »

Hello,

I recently created a membership listing form for a website. It has an administrative backend that will allow a user to insert, update, and delete member information. The backend seems to be working fine but on the public side, I sporadically receive an error that says:

Fatal error: Call to a member function on a non-object in /home/content/c/a/l/calvertmba/html/admin/members-admin/viewlist.php on line 10

Here is line 10 of my code:

***** PLEASE USE

Code: Select all

AND OTHER TAGS *****[/color]

Code: Select all

$maxRecord = 10;
$sqlbase = "SELECT * FROM members ".$myData->whereStr.$myData->getOrderString();
$sql = $sqlbase."LIMIT ".(($myData->actPageNr-1)*$maxRecord).",".$maxRecord;
$Result         = $MyDb->f_ExecuteSql($sql);
$ResultRowNr    = $MyDb->f_GetSelectedRows($Result);
$ResultTotalRow = $MyDb->f_ExecuteSql($sqlbase);
$totalRows      = $MyDb->f_GetSelectedRows($ResultTotalRow);
I created the database on my local server using PHPAdmin 2.6.3 & Mysql 5.0.2. The forms were created using PHP Wizard 0.3. They are residing on a server that is running Mysql 4.1

Any help would be greatly appreciated. I'm trying to finish this project by the end of the week.

Thank you
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Fatal Error: Call to Member

Post by Christopher »

stwallace wrote:Here is line 10 of my code:
There are seven lines of code there ... which line is line 10?

My guess is that either $MyDb or $MyData have not been instantiated.
(#10850)
Post Reply