Edit report at https://bugs.php.net/bug.php?id=31577&edit=1

 ID:                 31577
 Comment by:         tmylward at alphacrc dot com
 Reported by:        sand001 at sympatico dot ca
 Summary:            [chm] bug on function.dbase-add-record.html
 Status:             No Feedback
 Type:               Bug
 Package:            dBase related
 Operating System:   windows XP
 PHP Version:        5.0.2
 Block user comment: N
 Private report:     N

 New Comment:

I have a similar problem. I can read all of the 122 .DBF files supplied by my 
Company. 
However, when I attempt to open any file with read/write or writeOnly 
permissions, the file will NOT open.


Previous Comments:
------------------------------------------------------------------------
[2005-02-26 01:00:04] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2005-02-08 11:03:27] [email protected]

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


Please check if your webserver has all access privileges to the dbf file.

------------------------------------------------------------------------
[2005-01-16 22:34:09] sand001 at sympatico dot ca

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 this bug report at https://bugs.php.net/bug.php?id=31577&edit=1

Reply via email to