MySQL update query between two tables
UPDATE userphotos p, useralbums a
SET p.albumid = a.albumid
WHERE
a.userid = p.userid
AND a.album_name = “My Photos”
AND p.albumid = 0
http://stackoverflow.com/questions/4984646/mysql-update-query-between-two-tables