Hi All
I have this query that I have been fighting with all night. When I make a selection and submit the form the table shows up on the page but I get blank rows. I actually get the right amount of rows as the number of team that should be displayed. I can't seem to see where I am going wrong I tested the query in the MySQL query browser and it provides a result.
//Form action
if (isset($_POST['submit'])) { // Check if the form has been submitted.
if ($_POST['SelDivision']) {
$d = escape_data($_POST['SelDivision']);
}
if ($_POST['SelStatus']) {
$s = escape_data($_POST['SelStatus']);
}
// Query the database.
$string = "SELECT team_id, team_name, team_hcoach, team_pass FROM team WHERE team_agegroup = \"$d\" AND team_complete = $s";
print $string . "<br>"; //Just for debugging
$lresult = mysql_query($string)or die(mysql_error());
echo " <table width=\"100%\" border=\"1\" cellpadding=\"3\">
<tr>
<td>Team ID</td>
<td>Team Name</td>
<td>Head Coach</td>
<td>Team Password</td>
<td>Team Rating</td>
</tr> ";
// Fetch and print all the records.
while ($row1 = mysql_fetch_array($lresult, MYSQL_NUM)) {
echo " <tr>
<td>{$row1['team_id']}</td>
<td>{$row1['team_name']}</td>
<td>{$row1['team_hcoach']}</td>
<td>{$row1['team_pass']}</td>
<td>{$row1['team_name']}</td>
</tr>\n";
} //End While
} //End If
echo "</table><br> ";