Thread: Some help
View Single Post
Old 02-27-2009, 07:10 PM   #5 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
This should actually give me an error: "Fatal blabla.. cannot convert object to string... blabla".. because it returns $this.. but it doesn't. It just displays blank.

Anyone see the problem?
That's because the return value (which is assigned to $fetch) isn't an object instance, it's NULL.

If some SQL is passed through to exeQuery, the else block is followed. This block just calls $this->loadQuery(SQL)->exeQuery(); then exits the if/else block. Following that route, nothing is returned from exeQuery so $fetch will be NULL which will print nothing when echoed.

As sketchMedia said, just put return before that loadQuery/exeQuery line.
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
Tanax (02-27-2009)