I yanked this example off of the annotated manual and I'm trying to figure
out how/why one of the statements works...

The example puts all of the results from an Oracle select statement in to a
table.  I can make it work, but I want to customize it.  Unfortunately I
think I may just be too inexperienced to figure out what the hell is going
on...  I get everything up until the second "while" statement.  

Can anyone explain to me what it's doing?  Would it be a bit easier to
understand if $column was renamed $row?  Is that more accurate?  What if I
wanted to format the data?  Would something like:

print "$data['row_name'], $data['row_name2'] $data[3] <br>";

work?

Maybe I'm way ahead of myself here...  anyone?  thanks in advance  John




$nrows = OCIFetchStatement($stmt,$results);
if ( $nrows > 0 ) {
   print "<TABLE BORDER=\"1\">\n";
   print "<TR>\n";
   while ( list( $key, $val ) = each( $results ) ) {
      print "<TH>$key</TH>\n";
   }
   print "</TR>\n";
   
   for ( $i = 0; $i < $nrows; $i++ ) {
      reset($results);
      print "<TR>\n";
      while ( $column = each($results) ) {   
         $data = $column['value'];
         print "<TD>$data[$i]</TD>\n";
      }
      print "</TR>\n";
   }
   print "</TABLE>\n";

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Aut insanit homo, aut versus facit


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to