watch and learn
| From: | chintan | Date: | Mon, 14 Mar 2005 09:14:54 +0000 |
| Subject: | watch and learn | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-38888@lists.php.net to get a copy of this message | ||
hi guys my code is as below just look at that and tell me what should i add to have two colomns in my table;
<?php
include ('connect.php');
$query = "SELECT * FROM stockiestandbookingagents order by city,companyname,postalcode";
$result = mysql_query($query) or die("Query failed");
for($e=0;$e<mysql_num_rows($result);$e++)
if($e<mysql_num_rows($result))
{
print $e+1;
print "<table border=1>";
for($r=0;$r<mysql_num_fields($result);$r++)
if($r<mysql_num_fields($result))
{
print "<tr><td><b>";
echo (mysql_field_name($result, $r));
}
if($line=mysql_fetch_array($result, MYSQL_ASSOC))
{
foreach($line as $col_value)
{
print "</b></td><td>$col_value</td></tr>";
}
}
print "</table>";
}
if($_GET[city] == "" && $coloumn == "")
{
print "<a href=StockiestandBookingAgents.php?city=%>click here</a> to see all";
}
else
{
print "<a href=serv01.php>click here</a> to becomeone";
}
mysql_free_result($result);
mysql_close($link);
?>