我在使用update子句更新postgressdb时遇到问题,其中itemid =“$ _get ['itemid']; < / p>
这是我的sql代码,但它返回警告:pg_query():查询失败:错误: strong> p>
和 它还返回“警告:pg_affected_rows() strong>期望参数1为资源,布尔值在第303行的D:\ Wamp \ wamp \ www \ Php \ CTea \ UpdateItem.php中给出” p>
我想我搞砸了一些东西,但无法弄清楚我搞砸了哪里和什么。 p>
div>
$ sql =“UPDATE tbl_item SET itemname ='”。$ _ POST ['ItemName']。“',highqntythreshold ='”。$ _ POST ['HQThreshold']。“',lowqntythreshold ='”。$ _ POST ['LQThreshold'] 。“',qntyperunit ='”。$ _ POST ['QPUnit']。“',itemtype ='”。$ _ POST ['IT']。“',description ='”。$ _ POST ['Description']。“ ',WHERE itemid ='“。$ _GET ['itemid']。”';“;
$ iteminfo = pg_query($ sql);
code> pre>
if(pg_affected_rows($ iteminfo)== 1)
{
$ msg =“成功添加新项目”,.ucfirst($ _ POST ['ItemName'])。“! “;
}
else
{
$ msg =”错误:保存项目数据!...“;
}
code > pre>