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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.