Hi,
I'm developing a site that has a listing of retailers.
The user can then click on the name of the retailer and a new page with its details would come up.
My problem is when I have franchise branches listed on it. I do not want to list every branch the franchise has on the same page as the rest of the retailers. I would like to set it so the franchise name would come up and there would be a link and the listing of branches of that particular franchise would come up in a new page.
I'm using php4 and MySQL.
Any ideas?
<?php
// open the connection
$conn = mysql_connect("localhost", "", ""
;
// pick the database to use
mysql_select_db("imperial",$conn);
// create the sql statement
$sql = "SELECT cat, sub, vname, vtel, vaddress, id, specials FROM place order by vname";
// execute the sql statement
$result = mysql_query($sql, $conn) or die(mysql_error());
print "<table border=1><tr><th><font class=\"header\">Name</font></th>";
print "<th><font class=\"header\">Category</font></th><th><font class=\"header\">sub</font></th><th><font class=\"header\">Specials</font></th><th><font class=\"header\">Address</font></th><th><font class=\"header\">Telephone</font></th></tr>";
// go through each row in the result set and display data
while ($newArray = mysql_fetch_array($result)) {
// give a name to the fields
$cat = $newArray['cat'];
$sub = $newArray['sub'];
$vname = $newArray['vname'];
$vtel = $newArray['vtel'];
$vaddress = $newArray['vaddress'];
$idv = $newArray['id'];
$specials = $newArray['specials'];
//echo the results on screen
echo "
<tr>
<td><a href=\"view.php?lnk=$idv\" target=\"_blank\">$vname</a><br><font class=\"listing\">$vaddress</font></td>
<td><font class=\"listing\">$cat</font></td>
<td><font class=\"listing\">$sub</font></td>
<td><font class=\"listing\">$specials</font></td>
<td><font class=\"listing\">$vaddress</font></td>
<td><font class=\"listing\">$vtel</font></td>
</tr>";
}
print "</table>";
?>
Reality is built on a foundation of dreams.
I'm developing a site that has a listing of retailers.
The user can then click on the name of the retailer and a new page with its details would come up.
My problem is when I have franchise branches listed on it. I do not want to list every branch the franchise has on the same page as the rest of the retailers. I would like to set it so the franchise name would come up and there would be a link and the listing of branches of that particular franchise would come up in a new page.
I'm using php4 and MySQL.
Any ideas?
<?php
// open the connection
$conn = mysql_connect("localhost", "", ""

// pick the database to use
mysql_select_db("imperial",$conn);
// create the sql statement
$sql = "SELECT cat, sub, vname, vtel, vaddress, id, specials FROM place order by vname";
// execute the sql statement
$result = mysql_query($sql, $conn) or die(mysql_error());
print "<table border=1><tr><th><font class=\"header\">Name</font></th>";
print "<th><font class=\"header\">Category</font></th><th><font class=\"header\">sub</font></th><th><font class=\"header\">Specials</font></th><th><font class=\"header\">Address</font></th><th><font class=\"header\">Telephone</font></th></tr>";
// go through each row in the result set and display data
while ($newArray = mysql_fetch_array($result)) {
// give a name to the fields
$cat = $newArray['cat'];
$sub = $newArray['sub'];
$vname = $newArray['vname'];
$vtel = $newArray['vtel'];
$vaddress = $newArray['vaddress'];
$idv = $newArray['id'];
$specials = $newArray['specials'];
//echo the results on screen
echo "
<tr>
<td><a href=\"view.php?lnk=$idv\" target=\"_blank\">$vname</a><br><font class=\"listing\">$vaddress</font></td>
<td><font class=\"listing\">$cat</font></td>
<td><font class=\"listing\">$sub</font></td>
<td><font class=\"listing\">$specials</font></td>
<td><font class=\"listing\">$vaddress</font></td>
<td><font class=\"listing\">$vtel</font></td>
</tr>";
}
print "</table>";
?>
Reality is built on a foundation of dreams.