简体   繁体   English

将mysql表迁移到DBF文件

[英]Migration of mysql table to DBF file

I am trying to import mysql table data to dbf (database foxpro) file using PHP.. 我正在尝试使用PHP将mysql表数据导入dbf(数据库foxpro)文件。

I am utilizing the dbase functions to *dbase_create* to create database with the field names as same as in mysql table and added records of the mysql table using dbase_add_record() function.. 我正在利用dbase函数* dbase_create *创建数据库,其字段名称与mysql表中的相同,并使用dbase_add_record()函数添加了mysql表的记录。

Default datatype and length for "DATE" in dbf file is "D" and "8". dbf文件中“ DATE”的默认数据类型和长度为“ D”和“ 8”。

But imported dbf file shows that field type = "D" and field_length = "0". 但是导入的dbf文件显示字段类型=“ D”和field_length =“ 0”。

Help to fix this problem thanks in advance 帮助解决此问题,谢谢

I think you should convert MYsql date to dbf date in php. 我认为您应该在php中将MYsql日期转换为dbf日期。

For example, 例如,

 $dbf_date = date('Ymd', strtotime($your_mysql_date));

Use $dbf_date during insert. 在插入过程中使用$ dbf_date。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM