Jump to content

PHP simple question about retreiving text from mySQL


cfjess012

Recommended Posts

$nav = "";
foreach($categories as $cid=>$vals) {
$sel = "";
if($cat == $cid)
	$sel = " class=\"selected\"";
$nav .= "					<a href=\"index3.php?c=".$cid."\"".$sel.">".$vals['category']."</a> | \n";
}
$nav = substr($nav, 0, strlen($nav) - 3);

$subnav = "";
$subsections = "";
$numSubs = 0;
foreach($subcategories as $sid=>$vals) {
$sel = "";
if($subcat == $sid)
	$sel = " class=\"selected\"";
$subnav .= "					<a href=\"index3.php?c=".$cat."&s=".$sid."\"".$sel.">".$vals['subcategory']."</a> | \n";

$numSubs++;

$subspacing = "";
if($numSubs % 4 != 0)
	$subtext =$subtext['subcategory'];
	$subspacing =" style=\"margin-right: 18px;\"";
$subsections .= "					<a class='subsection'".$subspacing." href=\"index3.php?c=".$cat."&s=".$sid."\"".$sel."\"><img src=\"/".$vals['splash']."\" alt=\"".$vals['subcategory']."\" subtext =\"".$vals['subcategory']."\" /></a>\n";

 

The code above relates to this site - http://www.mcgregorsfurniture.com/products/index3.php?c=2

 

My goal of this is to have the product category name listed under the image that you see. 

http://www.mcgregorsfurniture.com/products/index3.php?c=2

 

*Note that some of them do not have images.

 

For instance under the bed image, it should say "Bed" beneath it.

I created a table with the category name and image, but I can't seem to find the right script to pull the category name.  I just get the image.

 

Let me know if any of you could help, I'd greatly appreciate it!

 

Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.