Jump to content

Database and PHP


phpblues7

Recommended Posts

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.

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.