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

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -