![]() ![]() With a multi-million-record table, I can see how this might be a concern speed-wise, but perhaps Workbench itself can find-as-you-type, and limit the returned records for large tables. Im using phpmyadmin ( php & mysql ) and Im having a lot of trouble linking the tables using foreign keys. With phpMyAdmin, having configured 'name' as the "relational display column" for the recipe type table, you would see a drop-down containing entries for "breakfast," "lunch," "brunch," and so on when you create new records in the (parent) "recipe" table. In the Workbench form editor, we would like to see a drop-down for the 'recipe_type_id' in the recipes table that shows the first several columns of the other table, e.g.: I think with Workbench, it would be sufficient to show the first several columns in a drop-down, as a "minimum viable" solution.Īs a tangible example, imagine a table of recipes, with a FK called 'recipe_type_id' to an 'id' column in a "recipe type" table. phpMyAdmin solves this by storing a "relational display column" (ref: ) for the table in one of its metadata databases. In your case, A and B are related with the id column, which means that you can use a syntax similar to this one: SELECT a.id, a.name, a.num, b.date, b.roll FROM a INNER JOIN b ON a.idb. From there you can delete the foreign key constraint. A list of relationships will appear (if you have one) in a pop up window. Right click on the column which has the foreign key reference. One challenge, though, is that the form editor would need to have some notion of what the "display" column should be from the referenced table. To add foreign key in phpMyAdmin use below steps to do The key must be indexed to apply foreign key constraint. 4 Answers Sorted by: 24 Joining tables is a fundamental principle of relational databases. A tab with the information about table columns will open. ![]() The form editor already has this behavior for ENUM fields, for example. PHPMyAdmin drop down foreign key description It is possible in PHPMyAdmin to display the description of a foreign key, instead of the identifier field. ![]() The requester is asking that, for the fields which are FKs to another table, the allowable entries in the form editor for that field should be restricted exclusively to valid entries from the referenced "foreign" table, and presented in a "drop-down" control. Kevin Ernst Yes! Oh my yes, a thousand times 'yes'. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |