View product attributes function

1, Jump page design

微信图片_20180308150601.png

##Code:

">

2, Shopping cart page display

Create a new goodsshow.php file

 query($sql); $sql="select *from goods where id=".$id; $result=$mysqli->query($sql); while($row=$result->fetch_assoc()){ ?> 

" width="200">
数量:-+ 价格: 市场价: 出售价: ">
内容:
立刻购买 加入购物车

Because shopping websites basically count the number of clicks on which product a user clicks on, here we also add one to the hits field every time a user clicks

$sql="update goods set hits=hits 1 where id=".$id;

3, the effect is shown as follows:


微信图片_20180308151715.png

Continuing Learning
||
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!