phpblues7 Posted May 16, 2020 Share Posted May 16, 2020 I have two tables one with minfo and other is user both have u_id . i want to access that id in minfo so that it updates with information by that id of user in that data. somehow u_id becomes primary of second table and primary of 1st table. how should i update the value of u_id in second table any help will be appreacited. Quote Link to comment Share on other sites More sharing options...
gizmola Posted May 17, 2020 Share Posted May 17, 2020 Please execute a "show create table user" and "show create table minfo" and post the results here so we can see what you are talking about. 1 hour ago, phpblues7 said: somehow u_id becomes primary of second table and primary of 1st table. how should i update the value of u_id in second table any help will be appreacited. You want to update user or minfo? What column(s) do you want to update? You can update a table utilizing a join to another table for the purposes of update. For example: UPDATE user JOIN minfo ON minfo.u_uid = user.u_id SET user.some_thing = minfo.some_thing Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.