include("user.inc.php");
$connection=mysqli_connect(localhost,$username,$password,"test");
$query = "SELECT * FROM contacts";
$result = mysqli_query($connection, $query);
echo $result;
if(!$result)
{
echo "good";
while ($row = mysqli_fetch_assoc($result))
{
echo $row["userName"], $row["date"], $row["poem"];
}
}
mysqli_close($connection);
?>
there is my code and here is the error
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:\Inetpub\wwwroot\testmysql\testdisplayt.php on line 12
PHP Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:\Inetpub\wwwroot\testmysql\testdisplayt.php on line 12
i just cannot get this to work spent about 3 hours on this all the tutorials have the same problem, so i'm starting to think it's my php or sql setup.