Not done any programming for a few years so am somewhat rusty again.
I have two tables users table and users_profiles table. I want to update users_profiles table on the condition that user_uid matches on both tables (users.user_uid and users_profiles.user_uid) and where users.user_login = 'johndoe' and users.user_uid = '11'.
It wil be executed in a php script, so johndoe would actually be users username (whatever is stored in session and same for users_uid. For simplicitity i added dummy data.
I run the query in phpmyadmin and get syntax error near INNER JOIN. I just cannot figure out what i'm doing wrong (probably wrote it entirely wrong) and have spent few hours trying to work it out without success.
Heres my sql query.
UPDATE users_profiles SET users_profiles.user_fname = 'John', users_profiles.user_lname = 'Doe', users_profiles.user_gender = 'male' INNER JOIN users USING (user_uid) ON users.user_uid = users_profiles.user_uid WHERE users.user_login = 'johndoe' AND users.user_uid = '11'
any help much appreciated.
I am adding the error information i am getting when running query via phpmyadmin. I can only assume i am doing the sql query all wrong.
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN users ON users.user_uid = users_profiles.user_uid WHERE user' at line 7
Edited by genieuk: added error message i'm getting