Jump to content

how can i conect 2 tables in mysql?


alin19

Recommended Posts

i'm using phpmyadmin

 

would this work?

 

table 1:

CREATE TABLE `ion` (`id` INT( 2 ) NOT NULL ,`test` VARCHAR( 2 ) NOT NULL ,PRIMARY KEY ( `id` ) )

 

table 2:

 

CREATE TABLE `ion2` (`id_test` INT( 2 ) NOT NULL ,`id` VARCHAR( 2 ) NOT NULL ,PRIMARY KEY ( `id` ))

Link to comment
Share on other sites

i wish to make some conexion, when inserting in a table some values, some of them to be also inserted in the second one, the same with the update,

 

 

can you explain to me how can i pull the the data when i have the 2 tables linked?

 

 

table 1                            table2

 

 

id      nume                      id  prenume

 

with:

 

select * from 'table 1'   

 

i will get nume and prenume?

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.