Jump to content

Why does SQL work on my desktop and not on my server?


Recommended Posts

I'm pulling my hair out.

 

Server: 4.0.26-nt

Desktop: 5.0.51b-community-nt

 

Tables are identical on both servers:

+---------+-------------+------+-----+---------+----------------+
| Field   | Type        | Null | Key | Default | Extra          |
+---------+-------------+------+-----+---------+----------------+
| rid     | int(11)     | NO   | PRI | NULL    | auto_increment |
| pid     | int(11)     | YES  |     | NULL    |                |
| qid     | int(11)     | YES  |     | NULL    |                |
| uid     | int(11)     | YES  |     | NULL    |                |
| score   | varchar(2)  | YES  |     | NULL    |                |
| ractive | varchar(1)  | YES  |     | NULL    |                |
| shift   | varchar(2)  | YES  |     | NULL    |                |
| rcount  | varchar(4)  | YES  |     | NULL    |                |
| moddate | varchar(20) | YES  |     | NULL    |                |
+---------+-------------+------+-----+---------+----------------+

 

Code is identical:

<?php
$selectR = "
select r1.score, r1.moddate, r1.rcount, r1.uid
from resp r1
where r1.rcount = (
    select r2.rcount
    from resp r2
    where r2.uid=r1.uid
ORDER BY r2.rcount DESC LIMIT 1
    )
";
?>

 

One works, and the other gives me "Fatal error: SQL in ..."

 

?????

 

line 285:

$resultR = mysql_query($selectR) or trigger_error("SQL", E_USER_ERROR);

 

It's the PHP error. The MySQL error is a MySQL error, which I didn't post.

 

The problem lay in the MySQL versions. I upgraded the server to 5x and it fixed the problem, although I don't see what the problem was in the SQL.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.