我正在尝试更新 php 中的表,但我不断收到语法错误。
这是我所拥有的:
if (isset($_POST['inspect'])) {
// get gis_id from pole table to update fm_poles
$sql = "select gis_id from poles where pole_number = '".$_GET['polenumber']."'";
$rs = pg_query($sql) or die('Query failed: ' . pg_last_error());
$gisid = $row['gis_id'];
pg_free_result($rs);
// update fm_poles
$sql = "update fm_poles set inspect ='".$_POST['inspect']."',co_date = '".$_POST['co_date']."',size = '".$_POST['size']."',date = ".$_POST['date'].",brand ='".$_POST['brand']."',backspan = ".$_POST['backspan']." WHERE gis_id = ".$gisid."";
print $sql."<BR>\n";
$rs = pg_query($sql) or die('Query failed: ' . pg_last_error());
pg_free_result($rs);
}
这是它给我的错误:
更新 fm_poles set inspect ='20120208',co_date = '20030710',size = '30-5',date = 0,brand ='test',backspan = 300 WHERE gis_id =
错误信息:
查询失败:错误:字符 129 处输入结尾处的语法错误