I am trying to create a search and display form. Here is the php code:
<?php
if (isset($_Post['submitted'])) {
//Connect to the database
$include('connect.php');
$category = $_Post['category'];
$criteria = $_Post['criteria'];
$query = "Select * FROM Member WHERE $cateory = '$criteria'";
$result = mysqli_query($dbcon, $query) or die('error getting data');
echo "<table>";
echo "<tr><th>Member Number</th><th>First Name</th><th>Laast Name</th><th>Address</th><th>Address2</th><th>City</th><th>State</th><th>Zip</th><th>Phone</th><th>Chapter</th><th>Chapter Number</th></tr>";
while($row = (mysqli_fetch_array($result, MYSQLI_ASSOC)){
echo "<tr><td>";
echo $row['MemberNumber'];
echo "</td><td>";
echo $row['FName'];
echo "</td><td>";
echo $row['LName'];
echo "</td><td>";
echo $row['Address'];
echo "</td><td>";
echo $row['Address2'];
echo "</td><td>";
echo $row['City'];
echo "</td><td>";
echo $row['State'];
echo "</td><td>";
echo $row['Zip'];
echo "</td><td>";
echo $row['Phone'];
echo "</td><td>";
echo $row['Chapter'];
echo "</td><td>";
echo $row['ChapterNumber'];
echo "</td></tr>";
}
echo "</table>";
}//end of main if statement
?>
The line giving me the problem is the while statement. The error seems to say that I don't need the { at the end.