By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,995 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,995 IT Pros & Developers. It's quick & easy.

SQL Query works only in Win32!

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
> 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

P: n/a
- 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

P: n/a
- 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.