hello folks; no one in the database forum knows what's up with this, so here goes--

  1. I need to return 3 fields (in approx. 2,000 records) into an array. A 2D array is fine, if necessary.

  2. this doesn't work (parse error):

    				while(OCIFetch($debut_execute))
    {
    $debut_item[OCIResult($debut_execute, "SUBP_DISPLAY")] =
    'OCIResult($debut_execute, "MASKU_SCLRFK")', 'OCIResult($debut_execute, "MD_LEGACY")';
    }
    

and neither do any of the variations of it that I try. Parse errors.

  1. This doesn't return an error, but I have no idea if it's working properly, because it prints, for example "12345 is Array".
    				while(OCIFetch($debut_execute))  
    
    { 
    $legacy = OCIResult($debut_execute, "MD_LEGACY");
    $color_code = OCIResult($debut_execute, "MASKU_SCLRFK");
    
    $debut_item[OCIResult($debut_execute, "SUBP_DISPLAY")] = array($legacy,$color_code);
    }
    
    for ($i = 0; $i < count ($debut_item); $i++)
    {
    $line = each ($debut_item); print ("$line[key] is $line[value]<br>");
    }
    

    many thanks for any help, folks. knelson.
    while(OCIFetch($debut_execute))
    { 
      $legacy = OCIResult($debut_execute, "MD_LEGACY");
      $color_code = OCIResult($debut_execute, "MASKU_SCLRFK");
      $debut_item[OCIResult($debut_execute, "SUBP_DISPLAY")] = array($legacy,$color_code);
    }
    
    while(@list($key, $val)=@each($debut_item)) {
        echo "$key is $val <br>";
    }
    

    is this working ?

      thanks...but I can't get it to work. parse errors galore.

        could you please post the errors? and maybe the complete script if not toooooo long...

          the error is the standard "expecting a ' or )" one...

          and the code is actually all included in the previous posts.

          i've done a var_dump() to make sure that my arrays are actually being constructed, and they are, so that's good. for example:

          [" 2932 "]=> array(2) { [0]=> string(6) "019462" [1]=> string(3) "101" }
          [" 3078 "]=> array(2) { [0]=> string(6) "010641" [1]=> string(3) "101" }

            when you can see the var_dump your DB access seems to work, right?

            so, for your output THIS should work now:

            while(@list($key, $val)=@each($debut_item)) {
              while(@list($key2, $val2)=@each($val)) {
                echo "$key2 is $val2 <br>";
              }
            }
            

            but the previous code i postet also should have worked, and not result in an exprect-whatever error ...

            ?

              thank you very much. i will give them both another try....

                PHPThorsten: just so you know, I also received the parse error with the last bit of code you supplied:
                Parse error: parse error, expecting ','' or')'' in /usr/local/apache2/htdocs/digistills/scripts/color_debut_item_report.php on line 53
                (the first line of the script)

                thanks and have a good one. knelson.

                  Write a Reply...