php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11076 dbase_get_record return strange
Submitted: 2001-05-24 04:12 UTC Modified: 2001-05-29 19:50 UTC
From: vlad at etl dot ru Assigned:
Status: Closed Package: dBase related
PHP Version: 4.0.4pl1 OS: Linux RedHat6.2
Private report: No CVE-ID: None
 [2001-05-24 04:12 UTC] vlad at etl dot ru
I have any.dbf
and use follow code
$mas=dbase_get_record($db,$nm);
echo($mas[$i]);

after field type=date ('  .  .  ' in Norton DBview)
 $mas[$i]='                                                   xxxxxx'
where xxxxx is next fields of any.dbf
Why?
Help? 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-24 12:21 UTC] vlad@php.net
Could you send a small (like one or two records) .dbf file
that exhibits that behaviour? I didn't see anything that
could cause that by just glancing at the code. 

I won't have time to look at it for a couple of days and I
am not a dbase expert though, so I do not assign this one to
myself, but I'll look at it.

Vlad

 [2001-05-29 18:43 UTC] vlad@php.net
Well, that particular file in his database causes php to
return errorneous result (it adds a bunch of spaces in front
of the date, and messes up a couple of fields after that,
just appending them to the date field instead of placing in
the array as individual fields :( ).

I have a suspicion that the length of that particular date
field is not recognized properly, but the code is kinda
cryptic, so it'll take me a little while to figure that out,
if I can do that at all.
 [2001-05-29 19:50 UTC] vlad@php.net
This was a malformed dbf file. It had a date field length
set to 0x08 0x02 instead of 0x08 0x00, which effectively
made this field seem to be 520 characters long instead of 8.

Some tools are smart enough to recognize that (Norton DBview
is one of them), but not php (or excel and some others for
that matter).

I'll see if I can make it more friendly so it recognizes
malformed files, but for now the bug is closed.

vlad@etl.ru, if you want to see a 'fixed' version of your
file, email me and I'll send you a copy with that 1 byte fixed.

Vlad

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 23:01:29 2024 UTC