//$query = "INSERT INTO Users (FullName, LocationsID) VALUES ('".$FullName."','".$Location."');";
$query = "INSERT INTO 'Users' (FullName, Password, LocationsID, Position, Mobile, Note, EngineerID, FirstName, LastName, Username) VALUES ('".$FullName."','".$Password."','".$Location."','".$Position."','".$Mobile."','".$Note."','".$Engineer."','".$FirstName."','".$LastName."','".$Username."','".$Email."');";
$result=odbc_exec($insert, $query) or die("<p>".odbc_errormsg());
echo $query;
第一行工作第二行报告此错误。
[Microsoft][ODBC Microsoft Access Driver] Syntax error in query. Incomplete query clause.
答案 0 :(得分:0)
删除表名周围的单引号。
$query = "INSERT INTO [Users] (FullName, Password, LocationsID, Position, Mobile, Note, EngineerID, FirstName, LastName, Username) VALUES ('".$FullName."','".$Password."','".$Location."','".$Position."','".$Mobile."','".$Note."','".$Engineer."','".$FirstName."','".$LastName."','".$Username."','".$Email."');";
单引号用于转义字符串。