PHP code to retrive data from Mysql database and display the retrive data
this is the error message:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\wamp\www\examSystem\ViewStudentProfile.php on line 15.
this is my code.
<html>
<head> </head>
<body>
<?php
$con=mysqli_connect("localhost","root","","online_ exam");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT FROM student WHERE Student_ID = '$_POST[Student_ID]'");
while($row = mysqli_fetch_array($result, MYSQL_ASSOC))
{
echo $row['Student_ID'] . " " . $row['FName']. " " . $row['LName']. " " . $row['DOB']. " " . $row['Nationality']. $row['NoSemester']. $row['CGPA']. $row['Contact_No']. $row['Address'];
echo "<br>";
}
mysqli_close($con);
?>
</body>
</html>
-
Andrew H -
Thanks - 1 reply
Signature"You shouldn't come here and set yourself up as the resident wizard of oz." {{ DiscussionBoard.errors[8604533].message }}-
lloydblinks -
Thanks
{{ DiscussionBoard.errors[8737446].message }} -
-
-
Andrew H -
[ 1 ] Thanks - 1 reply
Signature"You shouldn't come here and set yourself up as the resident wizard of oz." {{ DiscussionBoard.errors[8604553].message }}-
lloydblinks -
Thanks
{{ DiscussionBoard.errors[8620960].message }} -
-