below is my code. $data is the result of the query and i want the PHP to realise when there are no results returned and display the echo "There were no matching results..." if the DB does return a result, echo the table. the following doesn't realise when there are no results returned...
if ($data == null) {
echo "<strong>There were no Matching Results...Please Return to the '<a href='section_search.php'>Section Search Page</a>'</strong></br></br></br>";
}
else {
echo "<table border=0 cellpadding=10>";
echo "<tr align = center bgcolor=white>
<td><b>Company</b></td><td><b>Section</b></td><td><b>Question</b></td><td><b>Answer</b></td>" ;
while($info = mysql_fetch_array( $data ))
{
echo "<tr>";
echo "<td width = 60px><b>".boldText($info['company_name'], $kword) . "</b></td> ";
echo "<td width = 60px><b>".boldText($info['section_name'], $kword) . "</b></td> ";
echo "<td width = 360px>".boldText($info['question'], $kword) . " </td>";
echo "<td width = 600px>".boldText($info['answer'], $kword) . " </td></tr>";
}
echo "</table>";
}
}
any help would be great!
Thanks