The below mentioned code works fine. Connects to the database, fetches the
result, and displays neatly in a table. If there is no data then it jumps to
the if condition and displays the error message. BUT if the 'if' condition
is running and no data is present the Table headings and the bottm of empty
table is still displayed above the error message. Can you please check and
share with me as in where exactly the logic is wrong.

---------- -------------- Code --------------- ------------

<h2>Your favorites search result</h2><div>You are here:  index.htm Home  >
Your favorites</div>            
        <div class="internalContentArea sgtable ">
                        <div class="tableHead">Sub-category search result</div> 
                                        <table width='100%' id='table1' 
<th scope="col">Shop name</th>

// database information
   $host = 'xxx';      
   $user = 'xxx';
   $password = 'xxx';
   $dbName = 'xxx';

@mysql_select_db($dbName ) or die( "Sorry But There Seems To Be A Problem
Connecting To The Database");

$query="SELECT * FROM shop";




while ($i < $num) {

echo "

?></tbody></table> index.htm < Back to search <div> 

if ($num == 0){

echo "
  <div class='alert'>The search criteria you entered did not generate any
result,  index.htm please try again .</div>

View this message in context: 
Sent from the Php - Database mailing list archive at Nabble.com.

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to