I have a results page that loops thru the query and displays the records, but only if there is more than 1 record?
I have tried several techniques and it does not work for only 1 record. Here is the code:
<?php
include ('../includes/x.php');
$result = mysql_query("SELECT * FROM Forms WHERE State='$State'",$db);
if (mysql_fetch_array($result) <1) {
echo "There are no records for ".$State.". Please hit the Back button and choose another state";
} else {
echo "<TABLE BORDER=2>";
echo"<TR><TD><B>First Name</B><TD><B>Last Name</B><TD><B>School</B><TD><B>Options</B></TD></TR>";
while ($myrow = mysql_fetch_array($result))
{
echo "<TR><TD>".$myrow["FirstName"]."<TD> ".$myrow["LastName"]."<TD>".$myrow["School"];
echo "<TD><a href=\"view.php?FormID=".$myrow[FormID]."\">View</a> or ";
//echo "<a href=\"delete.php?FormID=".$myrow[FormID]."\">Delete</a> ";
echo "<a href=\"addedit.php?FormID=".$myrow[FormID]."\">Edit</a> ";
}
echo "</TABLE>";
}
?>
What did I miss here?
Thanks,
Don