note 32020 added to function.dbase-get-record-with-names
| From: | gabriel dot menini at REMOVETHISabitab dot com dot uy | Date: | Tue, 13 May 2003 18:30:55 +0000 |
| Subject: | note 32020 added to function.dbase-get-record-with-names | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-47915@lists.php.net to get a copy of this message | ||
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]);
}
}
--
http://www.php.net/manual/en/function.dbase-get-record-with-names.php
http://master.php.net/manage/user-notes.php?action=edit+32020
http://master.php.net/manage/user-notes.php?action=delete+32020
http://master.php.net/manage/user-notes.php?action=reject+32020