Re: How to show specific records of a Dbase file

From: Date: Sun, 26 Aug 2001 20:56:07 +0000
Subject: Re: How to show specific records of a Dbase file
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-64544@lists.php.net to get a copy of this message
I've solved it! You have to put the field name of the DBF, not the array position. I don't know exactly why, but it worked for me. So the code is: for ($x = 1; $x < $quant; $x++) { $drec = dbase_get_record_with_names($dbf,$x); echo "$drec[NAME]<br>"; } Thanks a lot for your help! Best regards On Sun, 26 Aug 2001 16:05:36 -0400, hugh_bothwell@hotmail.com (Hugh Bothwell) wrote: > >"Er GalvãO Abbott" <erabbott@DONTSPAMterra.com.br> wrote in message >news:3b892a4e.2765570@news.php.net... > >> foreach ($drec as $nome) >> { >> echo "$nome<br>"; >> } > >> But I'm trying (unsucessfully) to show only one or two fields of each >> records.. > >Instead of foreach(), try something like > echo $drec[0].", ".$drec[1]; >(or whichever records it is you want). > >Note: in the PHP documentation, they specifically >suggest abandoning DBase for any of the free >SQL databases (MySQL, PostgreSQL, etc). > >

« previous php.general (#64544) next »