<?php
$conn= new mysqli("localhost", "my_user", "my_password", "world"); //changed for the sake of this question
$query = "select * from user;";
$result = $conn->query($query);
while ($row = $result->fetch_assoc()) {
echo '<dt>';
foreach($row as $field) {
echo'<dd>'.$row['FirstName'].'</dd>';
}
echo '</dt>';
}
?>
I am just trying to echo out one column in a database atm, and it doesn't seem to display anything. I was wondering if anyone could help me? I get this error
[23-Aug-2012 16:14:04] PHP Fatal error: Call to a member function fetch_assoc() on a non-object in /devel/cgreenheld/projects/Asgn1final/admin.php on line 51 -bash-3.2$