Page 1 of 1

MySQL won't do join queries

PostPosted: 10. February 2007 22:49
by Mountain Man
Hello,

Thank you in advance to all who can help with this problem.
MySQL won't do join queries. For example:

Code: Select all
SQL query:

SELECT `tbl1.fld1` , `tbl2.fld1`
FROM `tbl1` , `tbl2`
LIMIT 0 , 30
MySQL said: 

#1054 - Unknown column 'tbl1.fld1' in 'field list'


I understand that this has something to do with the settings of
phpMyAdmin and that there needs to be a controller user named "pma."
Can anyone tell me how to enable relational features in MySQL?

Cheers,

Mountain Man[/code]

RE: MySQL won't do join queries

PostPosted: 11. February 2007 00:37
by Mountain Man
Hello,

I have been doing more research. It is necessary to create a new version
of a certain set of tables in order to enable relational features with
phpMyAdmin.

I have attempted to run the script "create_tables_mysql_4_1_2+.sql"
without success. I get an error message that says:

"DROP_DATABASE" statements are disabled.

However, I am able to drop databases using the phpMyAdmin GUI. How
does one enable "DROP_DATABASE" in the SQL textarea?

Cheers,

Mountain Man

PostPosted: 11. February 2007 02:03
by Wiedmann
I understand that this has something to do with the settings of
phpMyAdmin

No. Just read your post:
MySQL said:
#1054 - Unknown column 'tbl1.fld1' in 'field list'

The error message is from MySQL and not from phpMyAdmin.

You should read the MySQL documentation about JOIN:
http://dev.mysql.com/doc/refman/5.0/en/join.html

(especially the changes from previous version to MySQL 5.x)


It is necessary to create a new version
of a certain set of tables in order to enable relational features with
phpMyAdmin.

That's already done for you. Just look at the predefined databases you have with XAMPP.

How does one enable "DROP_DATABASE" in the SQL textarea?

IMHO that's a setting in "config.inc.php" from phpMyAdmin.

Re: MySQL won't do join queries

PostPosted: 11. February 2007 02:03
by Dave_L
SQL query:

SELECT `tbl1.fld1` , `tbl2.fld1`
FROM `tbl1` , `tbl2`
LIMIT 0 , 30
MySQL said:

#1054 - Unknown column 'tbl1.fld1' in 'field list'


The backticks are placed incorrectly. The correct syntax is:

Code: Select all
SELECT `tbl1`.`fld1` , `tbl2`.`fld1`
FROM `tbl1` , `tbl2`
LIMIT 0 , 30

PostPosted: 12. February 2007 03:28
by Mountain Man
Thank you Wiedmann and Dave_L. You have solved my problem.

Cheers,

Mountain Man