On 8/20/06, Bigmark <[EMAIL PROTECTED]> wrote:
Can anyone tell me why this works on my localhost but gets an error on my
server:
<?php
$sql = "SELECT COUNT(*) FROM leaderboard WHERE points >=( SELECT points FROM
leaderboard WHERE username= '$username' )";
$result = mysql_query( $sql ) or die ( mysql_error() );
$rank = mysql_result( $result, 0 );
echo $rank;
?>
this is the error message but i cant figure it out:
Your Position 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
'SELECT points FROM leaderboard WHERE username= 'ainslie' )' at
They are different mysql versions.
Your localhost version is 4.1+ which supports sub-selects, the other
one is 4.0 or below.
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php