我收到此错误
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ''., SQL state 37000 in SQLExecDirect in D:\wamp\www\STAPP\sys_admin\1.php on line 23
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ''., SQL state 37000 in SQLExecDirect in D:\wamp\www\STAPP\sys_admin\1.php on line 23
<?php
require_once("../includes/database_connection.php");
$conn=odbc_connect('stapp','','');
if ( isset( $_FILES['userfile'] ) )
{
$csv_file = $_FILES['userfile']['tmp_name'];
if ( ! is_file( $csv_file ) )
exit('File not found.');
$sql = '';
if (($handle = fopen( $csv_file, "r")) !== FALSE)
{
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
{
$sql = "INSERT INTO `table` SET `column0` = '$data[0]',
`column1`= '$data[1]', `column2` = '$data[2]';";
$rs1=odbc_exec($conn,$sql);
}
fclose($handle);
}
// Insert into database
//exit( $sql );
exit( "Complete!" );
}
?>
第 23 行是 $rs1=odbc_exec($conn,$sql);
任何人都可以在sql语句中帮助我吗