PHPMyAdmin Designer View
If your table types don’t support foreign keys, you can still draw links in here, and phpMyAdmin will show the id fields as links to the data they represent, which is quite a nice touch (MyISAM doesn’t support foreign keys). If your database does support foreign keys, then I found this post which explained that you must have an index on the column that will be the foreign key as well as a primary key on the table it references in order to be able to create the foreign key. If you see a box like this:
then a “real” foreign key is being created. You can choose what happens when rows are created or updated in the table.
PhpMyAdmin has improved a lot since I last used it, and although I can’t see me using this feature a whole lot I think it’s a brilliant addition for people just starting out with databases. Being able to create a foreign key and then observe the effects, and also get a graphical representation of the structure they have represented can only help. I’ve always liked PhpMyAdmin for beginners because it shows what SQL it just ran and I think this feature is useful in the same sort of way. I had no idea it was here and got a few surprised responses when I tweeted about it – so I thought I’d share!
This is an AWESOME feature! Never seen it before and never heard anyone mention it. Thanks for pointing it out :)
Thanks Lorna, I’ve used PHPMyAdmin some years ago, but now that you mention it, it worth a look again :)
If I remember rightly, you need to install the “PHPMyAdmin” tables to get this (and other nice features like SQL Query bookmarking and history).
Don’t add these tables, it doesn’t work.
I didn’t have to do anything to enable this feature, I just installed it from aptitude and the tab was there and working. Maybe I have a new version of phpmyadmin?
Do you know how to make it work in xampp 1.7.7 ?
When I try to make a link, I get a loading 99% and another page loads and it displays about:blank in the address bar. Any ideas what is wrong?
You have to upgrade or otherwise install tables in order to enable these features, this is unfortunate for shared hosting customers as they are generally not installed, even if the feature is enabled.
if I design relationship and I don’t want it any more how can i remove it