toby,
Monday, June 24, 2002, 10:06:57 AM, you wrote:

t> i cant create tables, the tables which had NO foreign keys or they didmt 
t> refer to another table were created fine
t> but the ones WITH foreign key ... refferring to fieldz in other table(s)
t> cant be created

t> mysql>create table lang ( lang_id int auto_increment primary key,
t> lang_ char(20)
t> );

t> query ok, 0 rows effected

t> mysql>create table usr_inf ( foreign key lang_id refrences lang(lang_id),
t> );

t> gives me this error :
t> error 1064: u ve an error in ur sql syntex near 'refrences lang(lang_id)'at 
t> line 1

t> i even tried this without (lang_id) but it still doesnt work

t> where m i messing it up guyz ????

First of all both tables must be InnoDB; second you wrote a wrong
foreign key constraint. Take a look at:
        http://www.mysql.com/doc/S/E/SEC446.html

you can find example of creating tables with foreign key constraint.





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to