#31577 [NEW]: [chm] bug on function.dbase-add-record.html
| From: | sand001 at sympatico dot ca | Date: | Sun, 16 Jan 2005 21:34:11 +0000 |
| Subject: | #31577 [NEW]: [chm] bug on function.dbase-add-record.html | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-72270@lists.php.net to get a copy of this message | ||
From: sand001 at sympatico dot ca
Operating system: windows XP
PHP version: 5.0.2
PHP Bug Type: dBase related
Bug description: [chm] bug on function.dbase-add-record.html
Description:
------------
I have found a bug on page function.dbase-add-record.html
[chm date: 2004-12-26]...
I can read from a .dbf file with PHP but I cannot write to it. I have used
PHP to create the .dbf or I have used my normally created .dbf with the
same structure.
The same HTML input screen collects data so that I can write a .txt
delimited file with it and append it into the .dbf but the prescribed code
from the examples fails when the dbase_open() flag is set to '1' or '2' as
required to write the data.
All of the echo lines show me that the fields are filled properly. The
dbase_open() command works well when the flag is set to '0' for reading. I
can output the data that I have put into the .dbf by appending from the
.txt file.
Reproduce code:
---------------
<?php
$filename="collect.txt";
$name="$_POST[name]";
$street="$_POST[street]";
$city="$_POST[city]";
$prov="$_POST[prov]";
$country="$_POST[country]";
$postal="$_POST[postal]";
$tel="$_POST[tel]";
$mail="$_POST[mail]";
$fax="$_POST[fax]";
echo "<strong> $name</strong><br>";
echo "<strong> $street</strong><br>";
echo "<strong> $city</strong><strong>, $prov</strong><strong>,
$country</strong><br>";
echo "<strong> $postal</strong><br>";
echo "<strong> $tel</strong><br>";
echo "<strong> $mail</strong><br>";
echo "<strong> $fax</strong><br>";
$db=dbase_open("collectx.dbf",2) ;
$def = array (trim($name), trim($street), trim($city), trim($prov),
trim($country), trim($postal), trim($tel), trim($mail), trim($fax));
dbase_add_record($db, $def);
dbase_close($db)
?>
Expected result:
----------------
I expect to be able to fill a .dbf file with HTML input as collected in
the fields that echo their contents to me, above.
Thank you for your assistance.
Actual result:
--------------
Warning: dbase_open() [function.dbase-open]: unable to open database
collectx.dbf in c:\Inetpub\wwwroot\collect.php on line 23
--
Edit bug report at http://bugs.php.net/?id=31577&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31577&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31577&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31577&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31577&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31577&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31577&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31577&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31577&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31577&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31577&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=31577&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=31577&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31577&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31577&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31577&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31577&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31577&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31577&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31577&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31577&r=mysqlcfg