Hi,
As you can probably tell by now my knoweldge of MySQL is not very good.
I basically have two tables. One called userinformation and another called profiles
My userinformation table is like this:
CREATE TABLE `userinformation` (
`id` int(11) NOT NULL auto_increment,
`status` varchar(20) NOT NULL,
`username` varchar(20) NOT NULL default '',
`first_name` varchar(40) default NULL,
`last_name` varchar(50) default NULL,
`email` varchar(50) default NULL,
`password` varchar(200) default NULL,
`date_time` varchar(100) default NULL,
`ip` varchar(50) NOT NULL,
`activationkey` varchar(200) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
and my profiles table is like this
CREATE TABLE `profiles` (
`id` int(11) NOT NULL auto_increment,
`dob` varchar(50) collate latin1_general_ci NOT NULL,
`gender` varchar(40) collate latin1_general_ci NOT NULL,
`websiteurl` varchar(100) collate latin1_general_ci NOT NULL,
`location` varchar(100) collate latin1_general_ci NOT NULL,
`aboutme` varchar(3000) collate latin1_general_ci NOT NULL,
`interests` varchar(3000) collate latin1_general_ci NOT NULL,
`activities` varchar(3000) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ;
I basically want to link my profiles table to my userinformation table. I want the profiles table to use and share the Id's from my userinformation table.
Reason why is the profiles table need to be linked to usersinformation table so users profiles and userinformation is linked.
Problem is i have searched all over the net and don't understand any of the information i have seen, nothing seems to explain how to do it properly.
I am not sure if it something to do with foreign key.
I not got a clue what query to use, both my tables already exist.
If someone could help it would be much appreciated.
Thank you,
genieuk
The