RE: [PHP] DB query returning wierd results
| From: | Steve Edberg | Date: | Thu, 08 Aug 2002 18:45:54 +0000 |
| Subject: | RE: [PHP] DB query returning wierd results | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111712@lists.php.net to get a copy of this message | ||
At 1:51 PM -0400 8/8/02, Brian V Bonini wrote:
Why are you doing this fetch_object()? So I can access the data by feild names.If you need to save that first row separately as $content, you can make a simple modification in your code: just add the line mysql_data_seek($result,0); between $content = mysql_fetch_object($result); and $i=0; That will reset the result pointer back to the first record and you can proceed happily ever after. See http://php.he.net/manual/en/function.mysql-data-seek.php for more info. -steve -- +------------------------------------------------------------------------+ | Steve Edberg sbedberg@ucdavis.edu | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | +------------------------------------------------------------------------+ | The end to politics as usual: | | The Monster Raving Loony Party (http://www.omrlp.com/) | +------------------------------------------------------------------------+