php - SELECT AND THEN UPDATE COUNT number mysqli -


i'm trying rows table products, , update product_views too, @ same time,

select * `product` `id` = '26' , `product_enable`= '1' , update `product` set `product_views` = product_views+1; 

this code doesn't work, think can explain want do,... there way this, think making in 1 query should system right?

so, help

you did wrong way :

update `product` set `product_views` =       (select product_views `product` `id` = '26' , `product_enable`= '1')+1; 

Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -