【发布时间】:2013-11-23 18:04:30
【问题描述】:
无论我做什么,都会出现语法错误,我无法弄清楚为什么?
$sn= "INSERT INTO [Drive Errors](Serial Number) SELECT [Serial Number] FROM [Drive List] ORDER BY [Position]ASC";
odbc_exec($con,$sn);
谢谢,代码有效,但现在当我插入序列号数据时,所有以前的数据都被删除了。有什么建议么?
$sn= "INSERT INTO [Drive Errors]([Serial]) SELECT [Serial Number] FROM [Drive List] ORDER BY [Position]ASC";
odbc_exec($con,$sn);
//Selecting table(de) and row(pos) need it in brackets
$sql= "SELECT * FROM [Drive Errors] ORDER BY [Position]ASC";
$rs=odbc_exec($con,$sql);
if (!$rs)
{echo("Error");}
【问题讨论】:
-
这是您运行的准确查询吗?
-
数据库是ms-access数据库
-
那么为什么这个问题被标记为“mysql”和“odbc”?您是否使用 Access 链接表来操作 MySQL 数据库中的表?