note 58115 deleted from function.ocifetchinto by sixd

From: Date: Wed, 20 Nov 2013 19:46:04 +0000
Subject: note 58115 deleted from function.ocifetchinto by sixd
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-197578@lists.php.net to get a copy of this message
Note Submitter: php at natalian dot org ---- There might be a better way. <?php $conn = OCILogon('user', 'secret', 'DB'); $th = 0; // Table Header $query = 'select * from PAYMENT'; $stid = OCIParse($conn, $query); OCIExecute($stid); echo "<table>\n\n"; while (OCIFetchInto($stid, $row, OCI_ASSOC)) { if (!$th) { $keys = (array_keys($row)); echo "\n<tr>\n"; foreach ($keys as $k) {echo "<th>" . $k . "</th>\n";} echo "</tr>\n"; $th = 1; // Table header done ! } echo "\n<tr>\n"; foreach ($keys as $k) {echo "<td>" . $row[$k] . "</td>\n";} echo "</tr>\n"; $count = $count + 1; } echo "</table>\n\n"; echo "<h3>" . $count . " records</h3>"; OCILogoff($conn); ?>

« previous php.notes (#197578) next »