Error boolean code PHP

Post a reply

Smilies
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Error boolean code PHP

Error boolean code PHP

by PhisonP » 19/09/2016 3:10 pm

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\SQLPHP\config.php on line 23

this is my code
<?php

$dbHost = "localhost";
$dbUser = "root";
$dbPass = "MartAddmin";
$dbdatabase = "phpdb1";


$con = mysqli_connect($dbHost , $dbUser , $dbPass,$dbdatabase);

if(mysqli_connect_errno( ))
{
echo "Could not connect to database<br />";
echo mysqli_connect_error( );
}
else
{
echo "Succeasfully connected to database!<br />";
}

$result = mysqli_query($con ,"SELECT * FROM $dbdatabase");

while($row = mysqli_fetch_array($result))
{
echo $row["Student_ID"]." ".$row["Student_Name"]." ".$row["Student_Adress"]." ".$row["Student_Age"]."<br />";
}
echo "Finish while loop";
?>

Top