note 47488 added to function.odbc-fetch-into

From: Date: Wed, 17 Nov 2004 22:58:26 +0000
Subject: note 47488 added to function.odbc-fetch-into
Groups: php.notes 
Request: Send a blank email to php-notes+get-80673@lists.php.net to get a copy of this message
Here is a very simple mehod to dump SQL results into an array that can be edited and manipulated. ============================================== //Create the array: $row = array(); while (odbc_fetch_into($res, $row, ODBC_NUM)) { array_push($stuff,$row); } //The results are now in an array. To display the array as an HTML table we can use the following: foreach($stuff as $line){ echo "<tr>\n"; foreach($line as $field){ echo "<td>".$field."</td>\n"; } } ============================================== Using this method allows a person to control individual data elements in each row and field. I am far more familiar with ASP and the getrows function but this is the closest equivalent that I have been able to find. I good friend and co-worker was able to determine how to get this to work. Thanks Robby. ---- Manual Page -- http://www.php.net/manual/en/function.odbc-fetch-into.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47488 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47488&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47488&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47488&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47488&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47488&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47488&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47488&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80673) next »