MySQL Forums
Forum List  »  PHP

Valid query in mysql client fails totally in PHP?
Posted by: spamnot
Date: May 23, 2005 08:38AM

Hi guys,

Why is this valid syntax in the mysql command line client:

select t1.id from akl_lng_shows_link_table as t1, akl_afr_shows as t2,
akl_shows_genres_afr as t3 where t1.afr_id = t2.id and t2.genre_id = t3.id order
by t3.name ascretunrs the correct result, but in PHP 4.3.4 it returns

[Polarserver] 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 ''?
It seems that PHP does not support alias-selecting in MySQL queries?

I can do

select * from akl_lng_shows_link_table as t1, akl_afr_shows as t2, etc. etc.

just fine in PHP (4.3.4) but the moment I try, in PHP, to do

select t1.id from akl_lng_shows_link_table as t1, akl_afr_shows as t2,

MySQL keeps returning the above "empty" error.

Anybody heard of this before? Is it possible to select aliased tables' columns in PHP?

What I can't understand is that the query works 100% fine in the MySQL client and MySQLQueryBrowser, but refuses to execute in PHP, on the same database.

Any help appreciated!

Thanks...

Options: ReplyQuote


Subject
Written By
Posted
Valid query in mysql client fails totally in PHP?
May 23, 2005 08:38AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.