> Date: Sun, 19 Apr 2009 22:50:20 +0100
> From: andy-li...@networkmail.eu
> To: defati...@hotmail.com
> CC: mysql@lists.mysql.com
> Subject: Re: Need help with mysql prob
> 
> Hi,
> > Now I have successfully created a relationship between the two tables but 
> > how do I make sure the value of tbl1_id in tbl1 is equal to the value of 
> > tbl1_id in tbl2???
> > 
> 
> MySQL handles this for you. Simply INSERT the value into tbl1, then 
> INSERT the value of tbl1_id in tbl2. Then try INSERT'ing a value into 
> tbl2 that doesn't exist in tbl1_id and MySQL will throw an error and the 
> insert will fail.
> 
> Thanks,
> Andy

 

Hi Andy,

Thanks for your prompt response. However, since tbl1_id has an auto_increment 
value in tbl1, mysql is actually generating the values for it automatically. 


_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

Reply via email to