php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14562 dBase: Unable to obtain dBase file structure
Submitted: 2001-12-17 10:58 UTC Modified: 2003-07-15 13:23 UTC
From: tom dot polak at post dot sk Assigned: zak (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 4.1.0 OS: Solaris
Private report: No CVE-ID: None
 [2001-12-17 10:58 UTC] tom dot polak at post dot sk
Hello,
I would like to request feature for PHP dBase support functions.
It will be helpfull, if will be possible to read dBase file header information, 
not only number of fields and its names. For dBase importing is also 
important data type, length and precision (if applicable).
If you thing, that I can help you with this request, send me mail.
Thank you.
Best regards,
Tomas Polak

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-17 19:37 UTC] zak@php.net
I wrote a bit of sample code that may do what you want. 
Visit http://www.php-er.com/html/rn45re878.html - the 
first example for unpack() shows how to use unpack() to 
read the format of a dbf file.

I will take a look at adding the functionality to PHP* in 
a few weeks.

* As long as no one has a good reason for me not too. :)

 [2003-07-15 13:23 UTC] zak@php.net
Function dbase_get_header_info() has been added to the dbase 
extension. 
 
The function accepts a dbase connection handle as its sole argument 
and returns an array of associative arrays. 
 
The arrays are of the form: 
 
Array 
( 
    [0] => Array 
        ( 
            [name] => date 
            [type] => date 
            [length] => 8 
            [decimal places] => 0 
            [printf format] => %8s 
            [record offset] => 1 
        ) 
 
    [1] => Array 
        ( 
            [name] => name 
            [type] => character 
            [length] => 50 
            [decimal places] => 0 
            [printf format] => %-50s 
            [record offset] => 9 
        ) 
 
... 
 
The feature has been added to the CVS repository and will hopefully 
be included in the next major release of PHP after 4.3. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 03:01:32 2024 UTC