<table border="2">
<tr>
<th>Memeber Id</th>
<th>Lastname</th>
<th>Firstname</th>
<th>Birthdate</th>
<th>Gender</th>
<th>Status</th>
<th>Dedication Date</th>
<th>Acceptance Date</th>
<th>Baptism Date</th>
<th>Mother</th>
<th>Father</th>
<th>Decription</th>
</tr>
<?php
$con = mysql_connect("localhost", "root", "");
$er = mysql_select_db("memberdb");
$query = "insert into memberinformation values('$memberid','$lastname','$firstname','$birthdate','$gender','$status','$dedicationdate'
,'$acceptancedate','$baptismdate','$mother','$father','$description')";
$result = mysql_query($query);
$result = mysql_query("SELECT * FROM memberinformation");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
//you need to exit the script, if there is an error
exit();
}
while ($array = mysql_fetch_row($result));
{
echo "<tr>";
echo "<td>" . $row['memberid'] . "</td>";
echo "<td>" . $row['lastname'] . "</td>";
echo "<td>" . $row['firstname'] . "</td>";
echo "<td>" . $row['birthdate'] . "</td>";
echo "<td>" . $row['gender'] . "</td>";
echo "<td>" . $row['status'] . "</td>";
echo "<td>" . $row['dedicationdate'] . "</td>";
echo "<td>" . $row['acceptancedate'] . "</td>";
echo "<td>" . $row['baptismdate'] . "</td>";
echo "<td>" . $row['mother'] . "</td>";
echo "<td>" . $row['father'] . "</td>";
echo "<td>" . $row['description'] . "</td>";
echo "</tr>";
echo "<script> alert('Tama ka.'); </script>";
}
echo "</table>";
mysql_close($con);
?>
I have a problem because the code does not output what I am expecting. It should output the data from memberinformation table from the member database. Please help me if there is some lacking lines in this code or I have some mistakes.
$arrayand$rowaren't the same, and the semi-colon at the end ofmysql_fetch_row($result));also causes issues. Enabling error reporting probably would have given you these answers.