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
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
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
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
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
5 matches
Mail list logo