当前位置:Gxlcms > PHP教程 > 更新字段异常

更新字段异常

时间:2021-07-01 10:21:17 帮助过:14人阅读

更新字段错误
Fatal error: Uncaught exception 'com_exception' with message 'Source: Microsoft OLE DB Provider for ODBC Drivers
Description: [Microsoft][ODBC Microsoft Access Driver] UPDATE 语句的语法错误。' in D:\Workspace\PHP\alalan\adminalila\InfoLi\list_px.php:12 Stack trace: #0 D:\Workspace\PHP\alalan\adminalila\InfoLi\list_px.php(12): com->Execute('update info set...') #1 {main} thrown in D:\Workspace\PHP\alalan\adminalila\InfoLi\list_px.php on line 12

	if(@$_REQUEST["top"]!=""){
$top=@$_REQUEST["top"];
if(is_numeric($top)){

$sqlcp="update info set top=".$top." where id=".$_REQUEST["id"]; $conn->Execute($sqlcp);
}else{
showmsg("字符不正确!只能输入数字!!","list_px.php?wz=".@$_REQUEST["wz"]."&page=".@$_REQUEST["page"]."");
}
}
?>


------解决方案--------------------
因为top是sql语句内置的单词 跟like、order差不多 当作字段用的话要加上`号 比如`top`=...
------解决方案--------------------
他不是提示说 sql 指令错了吗?
你打印出来看看

人气教程排行