DB Fetch

From: Date: Thu, 20 Jun 2002 12:06:22 +0000
Subject: DB Fetch
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1717@lists.php.net to get a copy of this message
Hi. I've been porting my project from using direct pg functions to using PEAR::DB and I was wondering why I couldn't do the following: $db->setFetchMode(DB_FETCHMODE_ASSOC); $result = $db->query("select field1, field2 from table") while($element = $result->fetchRow()) { echo $element['field1']; echo $element[0]; } Howcome I can't reference with both 'field1' and 0 ? BS

« previous php.pear.general (#1717) next »