I have this query
SELECT pu.payroleId, u.userId, u.firstName, u.lastName
FROM users AS u, payrole_users AS pu
WHERE pu.firstName = u.firstName
AND pu.lastName = u.lastName
LIMIT 0 , 60
Which selects all userId
's from the users
table if the names matches the names in the payrole_users
table (if I've got the query right!). What I need is: for each userId
, I need to update the payrole_users.intranetId
field. Is this possible to do with just one query or would I need to store all these as an array and then loop through the array after and then update it?