squarehippo
05-04-2010, 12:16 AM
Can someone please explain why I'm getting:
Fatal error: Call to a member function close() on a non-object on line 67
Line 67 is: $result->close();
I can connect to the database but apparently, that's about it. The code was copied over from a development machine where it works. I copied the database over too and have verified everything using phpMyAdmin. I also set up a database user with full privileges and assigned that to the database. Am I missing anything??
$db = new mysqli('localhost', 'myUsername', 'myPassword', 'myDatabase');
$sql = "select * FROM listingTable";
$result = $db->query($sql);
//do stuff
$result->close();
$db->close();
Fatal error: Call to a member function close() on a non-object on line 67
Line 67 is: $result->close();
I can connect to the database but apparently, that's about it. The code was copied over from a development machine where it works. I copied the database over too and have verified everything using phpMyAdmin. I also set up a database user with full privileges and assigned that to the database. Am I missing anything??
$db = new mysqli('localhost', 'myUsername', 'myPassword', 'myDatabase');
$sql = "select * FROM listingTable";
$result = $db->query($sql);
//do stuff
$result->close();
$db->close();