MySQL won't do join queries

Problems with the Windows version of XAMPP, questions, comments, and anything related.

MySQL won't do join queries

Postby Mountain Man » 10. February 2007 22:49

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]
Mountain Man
 
Posts: 3
Joined: 06. February 2007 22:11

RE: MySQL won't do join queries

Postby Mountain Man » 11. February 2007 00:37

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
Mountain Man
 
Posts: 3
Joined: 06. February 2007 22:11

Postby Wiedmann » 11. February 2007 02:03

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.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: MySQL won't do join queries

Postby Dave_L » 11. February 2007 02:03

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
User avatar
Dave_L
 
Posts: 212
Joined: 23. October 2004 00:43

Postby Mountain Man » 12. February 2007 03:28

Thank you Wiedmann and Dave_L. You have solved my problem.

Cheers,

Mountain Man
Mountain Man
 
Posts: 3
Joined: 06. February 2007 22:11


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 200 guests