Code: Select all
<a href="product.php?category=<?php echo($rowї"cat_name"]); ?>"><?php echo($rowї"cat_name"]); ?></a> > <?php echo($rowї"item_name"]); ?>Thanks!
Philip
Moderator: General Moderators
Code: Select all
<a href="product.php?category=<?php echo($rowї"cat_name"]); ?>"><?php echo($rowї"cat_name"]); ?></a> > <?php echo($rowї"item_name"]); ?>Code: Select all
<?
echo $row['cat_name'] ; //emtpy ?
if($row[cat_name] !=NULL){
?>
<a href="product.php?category=<?php echo($row["cat_name"]); ?>"><?php echo($row["cat_name"]); ?></a> > <?php echo($row["item_name"]);
}
else
{
echo 'Sorry m8, nothing inthere';
}
?>Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php
$_GETї'product'] = $product;
#Connect to MySQL
$conn = @mysql_connect ("198.66.222.95",philip,"daisey2112")
or die("Err: Connection Failed");
#select the specified database
$rs = mysql_select_db("jeap", $conn)
or die ("Err: Database Selection Failed");
#create the query
$sql="select * from products where item_number = "$product""
or die("Didn't select product");
#execute the queries
$rs = mysql_query($sql,$conn);
$row=mysql_fetch_array($rs);
#select the product record to be used
$rs_product = mysql_query("select * from products where item_number = "$product"",$conn)
or die ("Didn't select records");
#translate resource ID into row
$row_col = mysql_fetch_row($rs_product)
or die("Err, translate");
#get size of $row_col for loop
$size = count($row_col)
or die ("Didn't get size");
#loop through arrays to get values
for ($i=0; $i < $size; $i++)
{
#located columns with "Col_Y" as result
if ($row_colї$i] == "Col_Y")
{
$field_col = mysql_fetch_field($rs_product, $i)
or die("Didn't fetch field");
#Selects color info (gif url/name) based on having the same name as $field_col then creates the html to display
$rs_colors = mysql_query("select * from colors where color_name = "$field_col->name"")
or die("Didn't select colors based on field_co");
#translate resource ID into row
$row_col_colors = mysql_fetch_array($rs_colors)
or die("Err, translate #2");
#generate html
$color_selected .= "<img src="$row_col_colorsїcolor_img]" alt="$row_col_colorsїcolor_name]" width="30" height="13" border="1"> ";
}
}
#create the query for the side links
$cats=mysql_query("select * from products where cat_name = "$rowїcat_name]"",$conn);
#loop through result and generate html for side links
while ($cat_row = mysql_fetch_array($cats))
{
$cat_links .="<li><a href="product.php?product=$cat_rowїitem_number]">$cat_rowїitem_name]</a></li>";
}
?>Code: Select all
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="mainrepeating">
<!--DWLayoutTable-->
<tr>
<td width="19" height="19"> </td>
<td width="168" rowspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="168" height="27" valign="top" class="catheader"> <? echo($rowї"cat_name"]); ?> </td>
</tr>
<tr>
<td height="114" valign="top" class="catbody">
<ul> <? echo ("$cat_links"); ?> </ul>
<p align="center"><a href="#">View Full Catalog</a></p></td>
</tr>
<tr>
<td height="98" valign="top"><a href="order_online.htm"><img src="images/order_panel.gif" width="168" height="98" border="0"></a></td>
</tr>
<tr>
<td height="107" valign="top"><a href="contact_us.htm"><img src="images/contact_panel.gif" width="168" height="98" border="0"></a></td>
</tr>
</table></td>
<td colspan="5" valign="top" class="crumbs"><a href="index.htm">Jeap</a>
> <a href="product.php?category=<?php echo($rowї"cat_name"]); ?>">
<?php echo($rowї"cat_name"]); ?></a> > <? echo($rowї"item_name"]); ?></td>
</tr>
<tr>
<td height="78"></td>
<td width="6"> </td>
<td colspan="4" valign="top" class="header1"> <?php echo($rowї"item_name"]); ?> </td>
</tr>
<tr>
<td height="280"></td>
<td> </td>
<td width="13"> </td>
<td width="24"> </td>
<td width="220" valign="top"> <?php echo("<img src="$rowїimg]" border="1">"); ?> </td>
<td width="313" valign="top" class="ProductContent"> <p> </p>
<? if ($rowї"material"] != NULL) {
echo ("<p><strong>MATERIAL</strong>: $rowїmaterial]</p> ");
} ?>
<? if ($rowї"weight"] != NULL) {
echo ("<p><strong>WEIGHT</strong>: $rowїweight] </p>");
} ?>
<ul>
<? if ($rowї"bullet_1"] !="NULL") {
echo ("<li>$rowїbullet_1]</li>"); }
if ($rowї"bullet_2"] !="NULL") {
echo ("<li>$rowїbullet_2]</li>"); }
if ($rowї"bullet_3"] !="NULL") {
echo ("<li>$rowїbullet_3]</li>"); }
if ($rowї"bullet_4"] !="NULL") {
echo ("<li>$rowїbullet_4]</li>"); }
if ($rowї"bullet_5"] !="NULL") {
echo ("<li>$rowїbullet_5]</li>"); }
if ($rowї"bullet_6"] !="NULL") {
echo ("<li>$rowїbullet_6]</li>"); }
?>
</ul>
<p><strong>COLORS</strong>:<br>
<?
#color stuff goes here
echo ("$color_selected <br>");
?>
</p></td>
</tr>
<tr>
<td height="157"></td>
<td> </td>
<td colspan="4" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="75"></td>
<td> </td>
<td> </td>
<td colspan="3" valign="top"><p><a href="tell_pop.htm" onClick="MM_openBrWindow('tell_pop.htm','','width=465,height=345'); return false">Tell a friend about us!</a></p>
<p><a href="specials_pop.htm" onClick="MM_openBrWindow('specials_pop.htm','','width=465,height=345'); return false">Sign up for our e-mail specials.</a></p></td>
</tr>
</table>