cart.php45行去掉后面的."
$query="select Productprice,Productname from Product where Productid=".$ProductID.";==>$query="select Productprice,Productname from Product where Productid=".$ProductID;
$query="select Productprice,Productname from Product where Productid=".$ProductID.";==>$query="select Productprice,Productname from Product where Productid=".$ProductID;
$query="select Productprice,Productname from Product where Productid=".$ProductID.";
-----^ 这里的."不要
中有$count它是一个局部变量而非类的属性值,你可直接用$this->count;
或者$count=$this->count;
你说的我不明白。 $this->count++;
$this->Cartitme[$count]["productid"]=$ProductID;
$this->Cartitme[$count]["qty"]=1;
$this->Cartitme[$count]["price"]=$price;
$this->Cartitme[$count]["productname"]=$pname;
这几句怎么该啊?我这些都是一个字一个字抄来的。
$this->Cartitme[$this->count]["qty"]=1;
$this->Cartitme[$this->count]["price"]=$price;
$this->Cartitme[$this->count]["productname"]=$pname;
$this->Cartitme[$count]["qty"]=1;
$this->Cartitme[$count]["price"]=$price;
$this->Cartitme[$count]["productname"]=$pname;
改为
$this->Cartitme[$this->count]["productid"]=$ProductID;
$this->Cartitme[$this->count]["qty"]=1;
$this->Cartitme[$this->count]["price"]=$price;
$this->Cartitme[$this->count]["productname"]=$pname;
-----^ 这里的."不要
为什么我按你们说的做后,页面会出现几十行的
Warning: Supplied argument is not a valid MySQL result resource in cart.php on line 48
我估计是MySQL的版本问题或PHP的问题,我该如何解决?
共有".($productcount/2+1)."页 现在是第".$page."页"; if($page!=1) echo "previous"; else echo "previous"; if($page!=($productcount/2+1)) echo "nexe"; else echo "next"; echo "跳到第页"; for($count=1;$count<=$msgs[0];$count++) { echo "
--------------------------------------------------------------------------------
"; echo "ProductID.".jpg width=150 height=200> "; echo " productname:".$msgs[$count]->ProductName."
"; echo " price:".$msgs[$count]->Price."
"; echo " 简介:".$msgs[$count]->Abstract."
"; echo " 详细介绍 放入购物车
"; } echo "
"; ?>