note 43275 added to function.ora-columnname

From: Date: Wed, 16 Jun 2004 14:46:51 +0000
Subject: note 43275 added to function.ora-columnname
Groups: php.notes 
Request: Send a blank email to php-notes+get-71146@lists.php.net to get a copy of this message
with this it's easy to write a function similar to mysql_fetch_array: function select($conn, $sqlcomm) { $result = array(); $cur = ora_open($conn) or die ("Open cursor failed: ".ora_error()); ora_parse($cur, $sqlcomm, 0) or die ("Wrong statement: ".ora_error()); ora_exec($cur) or die ("Statement execution failed: ".ora_error()); if ($cur){ $numCols = ora_numcols( $cur ); while (ora_fetch($cur)) { // Get each row $row = array(); for($i = 0; $i < $numCols; $i++){ // Loop through columns $row[ora_columnname($cur,$i)] = ora_getcolumn($cur,$i); $row[$i] = ora_getcolumn($cur, $i); } array_push($result, $row); } } return $result; } this function will return an array with column id-s and column names too. ---- Manual Page -- http://www.php.net/manual/en/function.ora-columnname.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43275 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43275&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43275&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#71146) next »