note 26577 added to function.odbc-fetch-object

From: Date: Tue, 05 Nov 2002 17:45:16 +0000
Subject: note 26577 added to function.odbc-fetch-object
Groups: php.notes 
Request: Send a blank email to php-notes+get-39002@lists.php.net to get a copy of this message
Here's a bit of code I came up with tha behaves just like mysql_fetch_object() function odbc_fetch_object($result) { $rs=array(); if(odbc_fetch_into($result,&$rs)) { foreach($rs as $key=>$value) { $fkey=strtoupper(odbc_field_name($result,$key+1)); $rs_obj->$fkey = trim($value); } } return($rs_obj); } Special thanks to previous posters for giving me a starting point for this code. -- http://www.php.net/manual/en/function.odbc-fetch-object.php http://master.php.net/manage/user-notes.php?action=edit+26577 http://master.php.net/manage/user-notes.php?action=delete+26577 http://master.php.net/manage/user-notes.php?action=reject+26577

« previous php.notes (#39002) next »