我的网站已在新服务器上移动,一切正常,但我收到UPDATE和INSERT MDB2错误:语法错误
这是我的代码:
$sql = "UPDATE {$db_conf['db_name']}.{$this->db_table} SET ";
foreach($attr as $key => $value)
{
if(is_numeric($value))
{$sql .= "{$key} = {$value}, ";}
else
{
$value=cleanupString($value);
if("" == $value)
{$sql .= "{$key} = NULL, ";}
else
{$sql .= "{$key} = \"{$value}\", ";}
}
}
$sql = substr($sql,'',-2);
$sql .= " WHERE cop_id = {$existing_id}";
$result = $handle_db->query($sql);
if(PEAR::isError($result))
{die("CoP::commit | UPDATE ".$existing_id." | ".$result->getMessage());}
return true;
}
任何帮助?