473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 2241
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Peter Abel | last post by:
Hi all, I'm working under W2k with Python 2.2.2 (#37, Oct 14 2002, 17:02:34) on win32 I have a file *test_data.txt* with the following content: 0123456789 0123456789 abcdefghi...
2
by: GujuBoy | last post by:
i have the following code...which works fine in UNIX but then i move it over to WINDOWS XP and check the sum on the same file that i tested on unix and i get different results. def...
1
by: | last post by:
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,...
9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
8
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with...
6
by: SamSpade | last post by:
Below is what I did in VB6 to set a form to be on top. It nolonger works. Questions: Is there a reason to expect it to not work because of the new VS? Is there a reason to expect it to...
0
by: John Browne | last post by:
I was attempting to set up my psql client on the Win32 version of postgres 8.0 beta 2 to be able to use an external editor. I set the environment variable in windows like so: ...
0
by: vijayasb | last post by:
Hi, I have 2 solutions to get CPU usage of a Process. In one i am using Performance Counters and in the second i am using Win32 API GetProcessTimes(). When i execute the my application using...
12
by: Kevin Blount | last post by:
I'm having a very odd issue, that arose this morning after working fine yesterday... here's a very simple script: 1: <?php 2: $test = $_GET; 3: echo "Hello" . $test . "<p>"; 4: ?>
5
by: sawilla | last post by:
First, I'm new to Python. I'm getting and error when I run Python 2.5.2 as a regular user in Vista but not when I run Python as an administrator. For example, if I type "import numpy" after I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.