gpt4 book ai didi

php - 奇怪的 mysql_update 函数似乎只获取 $this-> info

转载 作者:行者123 更新时间:2023-11-29 09:03:09 26 4
gpt4 key购买 nike

好吧,由于某种原因,我只收到发送到 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com