I've just started working with relatons within phpMyAdmin. I'm
going to implement the table within all my databases.
One thing
that I do is use indexes to other databases on the same server. My
reasoning (which may be flawed, I admit) is that I can organize by
basic feature of my intranet via database and put details into
individual tables.
For instance, I'm working on an IT database
for managing everything to do with all the computers in our
facility. One column in the main computer table is a link to the
employees table, indicating who the primary user of that machine
is. Of course, the employees table is in the HR database, and not the
IT database. So being able to do referential checks is not currently
possible (as far as I can find so far) within the current
implementation.
Thanks,
Michael
Logged In: YES
user_id=509287
hmm the join syntax as described in the MySQL Manual
doesn't show how to do a join between tables in different
databases and i used to be sure there is no way to do that.
Can you do a LEFT JOIN between tables which are not in the
same db??
Logged In: NO
Yes. It's in the section on naming tables. As long as it's on the same
server, a table (or a column, for that matter) in a different DB can be
accessed by prefixing the DB name and a dot. For instance, databases
A and B with tables T1 (cols c1 & c2) and T2 (cols c3 & c4) respectively,
working in A:
SELECT c1, c2, c3 FROM T1 LEFT JOIN B.T2 ON
T1.c1 = B.T2.c4
(not tested, but very similar to syntax I've been
using successfully for about 6 months.)
May be this feature request would be handy to implement along with 'Improve Relational View Interface' of http://wiki.phpmyadmin.net/pma/GSoC_2013_Ideas_List#Interface_improvements ?
Indeed, but it depends on how much time you think it will require.
Should be resolved by https://github.com/phpmyadmin/phpmyadmin/pull/438
Diff: