Ok I got this fixed now...
Apparently I was only retrieving one row and assigning it to the $rows variable.
The working code:
if(isset($_POST['find1'])) {
$result = findThePerson($_POST['fname'], $_POST['lname'], $_POST['email']);
if(mysql_num_rows($result) == 0)
echo "<p>No results were found!</p>";
else {
$counter = 0;
$tags = sprintf('
<table class="resultsTable">
<tr>
<td>Click on name to view additional information.</td>
<td> </td>
<td class="resultCount">%s Results Found</td>
</tr>', mysql_num_rows($result));
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if($counter % 2 == 0) {
$tags .= sprintf('
<tr class="even">
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>', $row["FirstName"]." ".$row["LastName"], $row["OccupationName"], $row["Phone1"]);
} else {
$tags .= sprintf('
<tr class="odd">
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>', $row["FirstName"]." ".$row["LastName"], $row["OccupationName"], $row["Phone1"]);
}
$counter++;
}
$tags .= '</table>';
echo $tags;
}
} else {
echo '<p class="searchNotice">Please fill in the form above to search for people you are looking for.</p>';
}
Close the thread please.