On Wednesday 19 February 2003 13:58, Prabu Subroto wrote: > > I did something very stupid in my development. I > > created a database with a couple of tables...but I > > forgot to defining the foreign key and the primary > > key > > So if my user updated a record of one table than the > > corresponding row on related table will not be > > updated > > too. That's why I had to write additional function > > to > > update the others related tables which are necessary > > to be updated too. > > > > Is it possible to define Foreign Key and Primary Key > > of my database after the tables have been created ? > > If yes, how?
Yes, use ALTER TABLE statement: http://www.mysql.com/doc/en/ALTER_TABLE.html -- 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