SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Threaded View

  1. #1
    SitePoint Wizard
    Join Date
    Apr 2000
    0 Post(s)
    0 Thread(s)
    Hey all,

    Hope someone is able to help me out here
    As suggested by the title, I'm using a 4 dimensional array to hold category information (hierarchially). I know the right data is in the right places in the array because I can do a print_r($array) statement and it shows it correctly.
    But here is the dilemma:

    I'm using a pair of loops to get down to the fourth level in the array:
    PHP Code:
      while ( list($key1,$val1)=each($cache["$categoryid"]) ) {
        while ( list(
    $key2,$category)=each($val1) ) { 
    And it just isn't working. No errors, warnings etc. Anything placed after that first while() statement just doesn't execute. Just above that I have:
    PHP Code:
    which works fine and produces this:
    PHP Code:
    1] => Array
    0] => 1
    [catid] => 1
    [1] => Advertising Services
    [name] => Advertising Services
    [2] => 0
    [parent] => 0
    [3] => Advertising Services
    [description] => Advertising Services
    [4] => 189
    [visits] => 189
    [5] => 0
    [hide] => 0

    which is exactly as it should be.

    I've been coding all day now so it's probably something silly but I'm getting desperate any help is extremely appreciated.

    Thanks in advance
    P.S. In case you're wondering what on earth this has to do with recursive functions, it is being used in a recursive function
    Last edited by James; Apr 28, 2001 at 22:51.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts