|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-05-25 18:38 UTC] jim
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 13:00:01 2025 UTC |
The following script doesn't create a properly formatted .dbf file according to MS Access and MS Foxpro. There are no data records; just the header. This appears to be something with the size being incorrect -- a table created from MS Foxpro with the same number of fields was larger; again, no data. Script is executed from the command line as: php -q <script-name ------------------------ BEGINNING OF CODE ---------------- <? # General constants: $fn = "rep.dbf"; $MAX_CD = 1; # Define the dbase structure: $db_struct = array( array( "cl_id", "n", 11, 0 ), array( "cl_name", "c", 60 ), array( "cl_address", "c", 100 ), array( "cl_city", "c", 50 ), array( "cl_state", "c", 50 ), array( "cl_zip", "c", 50 ), array( "cl_country", "c", 50 ), array( "cl_phone", "c", 50 ), array( "cl_email", "c", 50 ), array( "cl_handle", "c", 50 ), array( "cc_type", "c", 50 ), array( "cc_number", "c", 50 ), array( "cc_name", "c", 50 ), array( "cc_expDate", "c", 50 ), array( "sh_name", "c", 50 ), array( "sh_address", "c", 100 ), array( "sh_city", "c", 50 ), array( "sh_state", "c", 50 ), array( "sh_zip", "c", 50 ), array( "sh_country", "c", 50 ), array( "sh_phone", "c", 50 ), array( "do_subtotal", "n", 20, 4 ), array( "do_tax", "n", 20, 4 ), array( "do_shipping", "n", 20, 4 ), array( "im_subtotal", "n", 20, 4 ), array( "im_tax", "n", 20, 4 ), array( "im_shipping", "n", 20, 4 ), array( "ord_status", "c", 15 ), array( "label", "c", 4 ), array( "number", "c", 10 ), array( "artist", "c", 30 ), array( "title", "c", 30 ), array( "config", "c", 3 ), array( "genre", "c", 10 ), array( "type", "c", 4 ), array( "type1", "c", 6 ), array( "cost", "n", 8, 2 ), array( "list", "n", 8, 2 ), array( "sale", "n", 8, 2 ), array( "rel_date", "d" ), array( "spcl", "c", 1 ), array( "upc", "c", 13 ), array( "qty", "n", 11, 0 ), array( "vendor", "c", 4 ), array( "country", "c", 3 ) ); echo "creating $fn\n"; $id = dbase_create($fn, &$db_struct); echo "dbase has " . dbase_numfields($id) . " fields\n"; echo "closing database...\n"; dbase_close($id); echo "done.\n"; ?> ----------------------- END OF CODE -------------------