cfjess012 Posted February 21, 2008 Share Posted February 21, 2008 $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 https://forums.phpfreaks.com/topic/92352-php-simple-question-about-retreiving-text-from-mysql/ Share on other sites More sharing options...
cfjess012 Posted February 21, 2008 Author Share Posted February 21, 2008 anything? Link to comment https://forums.phpfreaks.com/topic/92352-php-simple-question-about-retreiving-text-from-mysql/#findComment-473214 Share on other sites More sharing options...
schilly Posted February 21, 2008 Share Posted February 21, 2008 Why can't you get the category name? If you have the category and image in the db just pull them out and display them. What's the problem? Link to comment https://forums.phpfreaks.com/topic/92352-php-simple-question-about-retreiving-text-from-mysql/#findComment-473219 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.