Excuse me; I read couple of same questions but still couldn't figure out the solution.
I have two tables
photo
table:
userID | photoID| score
users
table:
userID | totalScore
I want to pass the photoID
unique value to photo table (I mean I want to use only that value as an input variable in the query).
Then get the corresponding userID
in the photos table
Then use the resulting unique userID
in the users table to update totalScore
such as
totalScore = totalScore + score
In another words lets say my values are
photo table:
userID | photoID| score
bob | 5 | 500
users table:
userID | totalScore
bob | 5000
I want the users table to look like after a query with an input of photoId=5
userID | totalScore
bob | 5500
Hope I am clear enough.
___________________________EDIT________________________
https://stackoverflow.com/a/707668/842644
this one helped. It is possible that not every server supports update-join notation. wanted to share