mysql.com/doc/refman/5.0/
en/innodb-foreign-key-constraints.html.
Thus, we come back to the Structure page for the book table and add an ordinary
(non-unique) index to the author_id field producing:
??? ??? ???
???
Chapter 11
[ 183 ]
In the Relation view, we can again try to add the relation we wanted??”it works
this time!
We can also set some actions with the ON DELETE and ON UPDATE options. For
example, ON DELETE CASCADE would make MySQL automatically delete all
rows in the related (foreign) table when the corresponding row is deleted from the
parent table. This would be useful, for example, when the parent table is invoices
and the foreign table is invoice-items.
If we have not done so already, we should define the 'display field' for the
author table, as explained in the Internal phpMyAdmin Relations section.
In phpMyAdmin 2.11.x, we cannot see tables from a different database in order to
define a relation to them.
InnoDB Tables without Linked-Tables Infrastructure
Starting with phpMyAdmin 2.6.0, we see the Relation View link on the Structure page
of an InnoDB table even though the linked-tables infrastructure is not installed. This
brings us to a screen where we can define the foreign keys??”here for the book table.
Note that if we choose this way, the 'display field' for the linked table (author here)
cannot be defined, since it belongs to the phpMyAdmin's infrastructure, so we would
lose one of the benefits (seeing the foreign key's associated description).
Pages:
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182