MySQL Forums
Forum List  »  PHP

simple question...
Posted by: Kostas Tsirigos
Date: September 15, 2005 11:20AM

Hi everyone. I have the following code:

$domain_query.= $wclause_sql . " AND datab.name='UNIPROT' ";
$domain_result = mysql_query($domain_query) or die(mysql_error());


//print results in HTML
echo "<table width='75%' border=2 cellpading=1>";
echo "<tr>";
echo "<td align = \"center\"colspan=\"2\">Pattern search results</td>";
echo "</tr>";

while ( $line = mysql_fetch_array($domain_result, MYSQL_ASSOC) )

{
echo "<tr>";
foreach ($line as $col_value)
{
echo "<td width = \"50%\">$col_value</td>"
."<td width = \"50%\"><a href ='retrieve_entry.php?code=".$col_value."'>view entry</td>";
}
echo "</tr>";
}
echo "</table>";

I need to add the condition which will be executed if no records matching the user's query are found.
I need to have something printed out, like "Sorry, no records found".
What must I add??

Thanx

Options: ReplyQuote


Subject
Written By
Posted
simple question...
September 15, 2005 11:20AM
September 15, 2005 02:30PM
September 15, 2005 02:51PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.