Re: [PHP] syntax error help

2006-08-21 Thread Richard Lynch
Older version of MySQL does not support subselects. On Sun, August 20, 2006 5:18 am, Bigmark wrote: > Can anyone tell me why this works on my localhost but gets an error on > my > server: > > $sql = "SELECT COUNT(*) FROM leaderboard WHERE points >=( SELECT > points FROM > leaderboard WHERE user

RE: [PHP] syntax error help

2006-08-20 Thread Peter Lauri
eneral@lists.php.net Subject: [PHP] syntax error help Can anyone tell me why this works on my localhost but gets an error on my server: =( SELECT points FROM leaderboard WHERE username= '$username' )"; $result = mysql_query( $sql ) or die ( mysql_error() ); $rank = mysql_result( $re

Re: [PHP] syntax error help

2006-08-20 Thread chris smith
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: =( SELECT points FROM leaderboard WHERE username= '$username' )"; $result = mysql_query( $sql ) or die ( mysql_error() ); $rank = mysql_result( $result, 0 ); echo $ran

Re: [PHP] syntax error help

2006-08-20 Thread Paul Scott
On Sun, 2006-08-20 at 18:18 +0800, Bigmark wrote: > Can anyone tell me why this works on my localhost but gets an error on my > server: > Try quote your identifiers. SELECT COUNT(*) FROM `leaderboard` WHERE `points` >=( SELECT `points` FROM `leaderboard` WHERE `username` = '$username' ); --Pau

[PHP] syntax error help

2006-08-20 Thread Bigmark
Can anyone tell me why this works on my localhost but gets an error on my server: =( 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 figu