469,081 Members | 1,808 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,081 developers. It's quick & easy.

SQL Query works only in Win32!

I use MySQL from my php page and from phpMyAdmin.

In Windows Server, following query works fine. In Linux Server instead it
returns error.

The SQL Query is:
SELECT DISTINCT a.id, a.container, b.container FROM folder AS a JOIN folder
AS b ON a.container=b.id

The PHP error is:
You have an error in your SQL syntax near 'ON a.container=b.id' at line 1

So, I ask: If in Windows this query work fine, where is the error in the
Linux version?
Jul 19 '05 #1
3 2103
> I use MySQL from my php page and from phpMyAdmin.

In Windows Server, following query works fine. In Linux Server instead it
returns error.

The SQL Query is:
SELECT DISTINCT a.id, a.container, b.container FROM folder AS a JOIN folder AS b ON a.container=b.id

The PHP error is:
You have an error in your SQL syntax near 'ON a.container=b.id' at line 1

So, I ask: If in Windows this query work fine, where is the error in the
Linux version?


I see now this: problem only occur when have the keyword "ON" in *any* SQL
Query and only in Linux version of Server.
Maybe a permission error? Why? I have SELECT / UPDATE rights
The same problem with root account...
Jul 19 '05 #2
- Chameleon - wrote:
I use MySQL from my php page and from phpMyAdmin.

In Windows Server, following query works fine. In Linux Server instead it
returns error.

The SQL Query is:
SELECT DISTINCT a.id, a.container, b.container FROM folder AS a JOIN

folder
AS b ON a.container=b.id

The PHP error is:
You have an error in your SQL syntax near 'ON a.container=b.id' at line 1

So, I ask: If in Windows this query work fine, where is the error in the
Linux version?


I see now this: problem only occur when have the keyword "ON" in *any*
SQL Query and only in Linux version of Server.
Maybe a permission error? Why? I have SELECT / UPDATE rights
The same problem with root account...


I would go check at www.mysql.com ... their docs.
I recall something about ON only being available from certain versions of
MySQL ... but don't recall it in detail.

It might be as simple as an upgrade of MySQL on your linux box.

/Andreas
--
Registeret Linux user #292411
Jul 19 '05 #3
- Chameleon - wrote:
I use MySQL from my php page and from phpMyAdmin.

In Windows Server, following query works fine. In Linux Server instead it
returns error.

The SQL Query is:
SELECT DISTINCT a.id, a.container, b.container FROM folder AS a JOIN

folder
AS b ON a.container=b.id

The PHP error is:
You have an error in your SQL syntax near 'ON a.container=b.id' at line 1

So, I ask: If in Windows this query work fine, where is the error in the
Linux version?


I see now this: problem only occur when have the keyword "ON" in *any*
SQL Query and only in Linux version of Server.
Maybe a permission error? Why? I have SELECT / UPDATE rights
The same problem with root account...


I would go check at www.mysql.com ... their docs.
I recall something about ON only being available from certain versions of
MySQL ... but don't recall it in detail.

It might be as simple as an upgrade of MySQL on your linux box.

/Andreas
--
Registeret Linux user #292411
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Peter Abel | last post: by
2 posts views Thread by GujuBoy | last post: by
9 posts views Thread by netpurpose | last post: by
12 posts views Thread by Kevin Blount | last post: by
5 posts views Thread by sawilla | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.