好吧,由于某种原因,我只收到发送到 mysql 数据库的 $this-> 信息
即:应该是这个
"UPDATE `shop_products` SET shopid = 1 WHERE id = 42"
但是我得到了这个
"UPDATE `shop_products` SET 1 WHERE 42"
这是我正在使用的代码。 我不知道为什么这不起作用
public function addstoreproduct($id,$shopid,$categoryid,$productname,$description,$price,$rcb)
{
$this->id = $id;
$this->shopid = $shopid;
$this->categoryid = $categoryid;
$this->productname = $productname;
$this->descriptionid = $description;
$this->price = $price;
$this->rcb = $rcb;
mysql_query("UPDATE `shop_products` SET shopid = "+$this->shopid+" WHERE id = "+$this->id+"");
//$this->updatedb('shop_products','shopid='+$this->shopid+'','"id='+$this->id+'"');
}
最佳答案
尝试
mysql_query("UPDATE shop_products SET shopid = ". $this->shopid . "WHERE id = ". $this->id);
关于php - 奇怪的 mysql_update 函数似乎只获取 $this-> info,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7923896/