there's no 'logic' error at all that I can see.  It's more a design
error as it doesn't do the job the way that you describe it at all. 
  What actually happens is that the starting HTML (heading and table
start)  is output before the database is even contacted, so there's no
way for you to take the table back if you don't receive any relevant

try something more like this:

// 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";



if ($num) {
<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>


while ($i < $num) {

echo "

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

} else {

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


You'll probably need to polish this some, because I quickly cut/pasted
it before I go down the pub.


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

Reply via email to