Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 20th, 2005, 05:23 AM
Registered User
Join Date: Apr 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with displaying sub-cats...

Hi, I run a small News-script using mySQL/PHP and use the following function to call the category table and create a you-are-here link menu...

The category table consists of 4 fields
xid (cat id auto inc)

function caturher($xid)
      global $T_Catalog;
      $sql = "select catalogname,parentid from TableCatalog where xid='$xid'";
      $result = $this->select($sql);
      $cat = $result[0]["catalogname"];
      $parent = $result[0]["parentid"];
      if ($parent != "0") {
      $sql = "select xid,catalogname from $T_Catalog where xid='$parent'";
      $result2 = $this->select($sql);
      $txid = $result2[0]["xid"];
      $tcat = $result2[0]["catalogname"];
      $urher = "\n<a class=\"you_menu\" href=\"?choice=section&amp;xid=$txid\">$tcat</a> &raquo; ";
      $urher .= $cat;
      return $urher;

It works fine for 2 levels, e.g. home > news > archive, but if I add a subcat "test" under "archive" it displays home > archive > test instead of home > news > archive > test which off course would be the desired path to show...

I've tried various things like foreach and a while loop but I can`t seam to get this function to do what I want it to, namely to be able to print the path for "unlimited" number of sub categories.

Any help is VERY MUCH appreciated :(
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems Displaying an image retrieved from SQL Se jazzcatone ASP.NET 1.x and 2.0 Application Design 2 September 3rd, 2005 09:53 AM
problems displaying data p2ptolu PHP Databases 2 May 12th, 2005 01:12 AM
validate.asp problems and logon.asp problems p2ptolu Classic ASP Databases 0 February 16th, 2005 02:34 PM
Problems displaying images via a variable nancy Classic ASP Basics 2 June 2nd, 2004 02:17 PM
Problems displaying web pages using IIS kathryne Classic ASP Professional 1 November 14th, 2003 12:48 PM

All times are GMT -4. The time now is 07:39 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.