Hi,

I am trying to insert date into Foxpro 2.6 .dbf file using ODBC & PHP i
am getting following error

SQL error: [MERANT][ODBC dBase driver]An INSERT value didn't match the data type of its corresponding column, SQL state 37000 in SQLPrepare in c:\apache\htdocs\ess\dbf.php on line 54

I tried different date formats but it is not working.Can anybody help me regarding date format problem between PHP and Foxpro,I think foxpro supports MM/DD/YY Format,I am new to php,Please help me.Thanks

regards,
Tara Mankeekar
tm_mankeekar@yahoo.com

my code is as follows :

<?php

$date = "1999-01-01"; //Date to be inserted,following combinations are not working
//$date = "01/01/99";
//$date = "01/01/1999";
//$date = "1999/01/01";
//$date = "99/01/01";
//$date = "01-01-99";
//$date = "01-01-1999";
//$date = "99-01-01";
//$date = "010199";
//$date = "01011999";
//$date = "19991010";
//$date = "990101";

$connection=odbc_connect("Ess","","");

$sql="INSERT INTO gr_mst(gr_dt) VALUES('$date')";

$sql_result=odbc_prepare($connection,$sql);
odbc_execute($sql_result);
odbc_close($connection);

?>

    Write a Reply...