List:MySQL and PHP« Previous Message
From:Albert Coder Date:July 4 2014 4:51pm
Subject:Problem creating Index through SQL file
View as plain text  
Hello !

I wish to link all the tables of database using foreign keys. Right
now I have been able to link all the tables manually, partially
through SQL file and partially through phpmyadmin. I wish to do all
this in an automated way.

See [1] to have a clear view of database design and linking.

The problem I am facing is that whenever a user clicks on add new
trait, a new table is created(by SQL query behind) but I am unable to
link that automatically to material table using foreign key constraint
by coding in the SQL file. I can do that by adding index in phpmyadmin
for that [2]. But that's not what is required. See the code of SQL
file in [3] which I import to create tables required for MediaWiki
extension. You can also see the foreign key constraints added in [3]
at the last.

[1] http://awesomescreenshot.com/0ce33e0s4d

[2] http://awesomescreenshot.com/0f233hiqc7

[3] http://goo.gl/0c840Q

-- 
Thanks
Albert
www.coderalbert.wordpress.com
https://github.com/albertcoder/
" Eat Sleep Conquer Repeat "
Thread
Problem creating Index through SQL fileAlbert Coder4 Jul 2014