I am just looking for a simple way to test if my database is working. Wanted to get a listing of the contents of the user table from my bookmarks database but the code I am using generates the following errror message.
Fatal error: Call to a member function fetch_assoc() on a non-object in /home/consult/public_html/development/Testing/26/dbtest2.php5 on line 14
The code running in php5 is as follows:
<?php
$mysqli = new mysqli('localhost',"consult_test", "password");
$mysqli->select_db("consult_bookmarks");
$result = $mysqli->query("SELECT * FROM users");
while($row = $result->fetch_assoc()) {
print $row['username'] . ' ' . $row['passwd'].' ' . $row['email']. '<br/>';
}
$result->close();
?>
Are you guys sure this php stuff works! j/k - just wish I knew what I was doing wrong. At least I got the parsing errors sorted!