note 32020 deleted from function.dbase-get-record-with-names by didou
| From: | didou@php.net | Date: | Sat, 29 Jan 2005 23:31:03 +0000 |
| Subject: | note 32020 deleted from function.dbase-get-record-with-names by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-84178@lists.php.net to get a copy of this message | ||
Note Submitter: gabriel dot menini at REMOVETHISabitab dot com dot uy
----
That's right, field names must be placed using caps.
But I wasn't able to access the values using something like
echo $drec['ITEM'];
I had to use echo $drec[ITEM]; instead, withouth the simple quotes
After removing the simple quotes everything went allright.
$table = 'C:\my\path\mytable.dbf';
if (!$FileHandler = dbase_open($table,0) ) {
echo "Can't open $table\n";
exit;
} else {
$rowcount = dbase_numrecords ( $FileHandler);// How many records?
for ($i=1; $i <= $rowcount; $i++) {
$row = dbase_get_record_with_names($FileHandler,$i);
echo chop($reg[ID_EMP]) . " : " .
chop($reg[ID_SUBEMP]) . " : " .
chop($reg[NAME_EMP]);
}
}