|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
MySQL 5 - Having problems with this piece of code
Hi Guys
I am a newbie here and I am having problems with this piece of code: Code:
default : // list operation $stmt = $db->prepare('SELECT id, email FROM users'); $stmt->execute(); $stmt->bind_result($id, $email); // not good for large datasets $results = array(); while ($stmt->fetch()) { $results[] = array('id' => $id, 'email' => $email, 'quota' => $quota); } $stmt->close(); include WORKING_DIR.'/list.inc.php'; } $db->close();
this is what im getting on error code: Fatal error: Call to a member function execute() on a non-object in /var/www/index.php on line 107 |
|
#2
|
|||
|
|||
|
I guess the error message itself explains your problem. $stmt is not a valid object. Make sure you're using correct syntax to initialize it before invoking it's methods.
Note:- Try to post the code formatted and use php tags to enclose your code.
__________________
Tomorrow might never be.. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > MySQL 5 - Having problems with this piece of code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|