forum

Home / DeveloperSection / Forums / select record one table and update another table

select record one table and update another table

Anonymous User 1944 06-Nov-2014

I am  trying to get 'business_id' and 'rating' from the table 'reviews' where 'review_id' is $approveReviewID

and then update 'rating' in 'business_details' with this retrieved rating from 'reviews' where 'business_id' is equal to that retrieved.

I have these two queries,

SELECT business_id, rating FROM reviews WHERE review_id = '$approveReviewID'
UPDATE business_details SET rating = rating + $rating WHERE business_id = '$businessID

is there a way to join these queries into one?


Updated on 06-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By