| Index
» Projects
» phpMyEdit
» Forum
» Once again: Drop down |
 |
Silberdrache
Joined: 08 Sep 2006
Posts: 7
Posted: 2006-09-13 15:00
Back to top
Reply with quote
|
Hello,
although I've been searching the forum for hours
I could not find a working solution:
I created a formular for a table to alter it's data.
One of the formular-fields should be a drop-down
which values should come from another table.
So I have to access two tables within one formular.
Is there any example available how to to this ?
|
Silberdrache
Joined: 08 Sep 2006
Posts: 7
Posted: 2006-09-14 11:13
Back to top
Reply with quote
|
I tried exactly the same example as shown here:
http://opensource.platon.sk/forum/projects/viewtopic.php?t=455
I created the two tables and used the provided code,
but all I get is:
MySQL error 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-acap.tableb AS PMEjoin2 ON PMEjoin2.B_ID = PMEtable0.B_ID' at l" (where "admin-acap" is the name of my DB).
The query looks like this:
SELECT PMEtable0.A_FD1 AS qf0,PMEtable0.A_FD2 AS qf1,PMEjoin2.B_FD2 AS qf2,PMEtable0.B_ID AS qf2_idx,PMEtable0.A_FD1 FROM tablea AS PMEtable0 LEFT OUTER JOIN admin-acap.tableb AS PMEjoin2 ON PMEjoin2.B_ID = PMEtable0.B_ID LIMIT 0,151
I am using the latest 5.5. All the time when I try
to lookup multiple tables I get MySQL errors.
Could please someone try the example above with
5.5 and tell me if it's working ?
|
Silberdrache
Joined: 08 Sep 2006
Posts: 7
Posted: 2006-09-14 12:59
Back to top
Reply with quote
|
I found out what the problem is:
The "-" in the database name. Have a look at:
http://dev.mysql.com/doc/mysql/en/legal-names.html
I don't know how to solve yet, but the problem is
clear because with database name "acap" everthing
is working fine.
Now even the dropdown is working perfectly.
|
|
Post new topic
Reply to topic
|
|
|
|