I’m trying to update a table that is joined with another one to update the right record. Here is my command so far:
UPDATE
links l
SET
l.l_id = `[value-1]`,
l.l_facebook = `[value-2]`,
l.l_youtube = `[value-3]`,
l.l_twitter = `[value-4]`,
l.l_googleplus = `[value-5]`,
l.l_rss = `[value-6]`,
l.l_homepage = `[value-7]`,
l.l_freigegeben = `[value-8]`
JOIN
sponsering ON l.l_id = sponsering.links_l_id
WHERE
sponsering.s_userID = 2
Trying to run the command in phpmyadmin gives me the following error message:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'JOIN sponsering ON l.l_id = sponsering.links_l_id WHERE
sponsering.s_user' at line 12
I need to join the table sponsering
because this gives me the correct record in the links table.
How can I solve this?