Hello,
I'm having an issue with a sub select that should work.
function IsClanLeader ($char_id) {
global $lin2world;
$sql = "
SELECT ruler_id
FROM Pledge WITH (nolock)
WHERE (pledge_id =
(SELECT pledge_id
FROM user_data WITH (nolock)
WHERE (char_id = ".$char_id.")))";
$rs = mssql_query($sql, $lin2world) or die(mssql_get_last_message());
$data = mssql_fetch_assoc($rs);
if ($data['ruler_id'] != $char_id) {
return false;
} else {
return true;
}
}
The SQL works fine in the SQL management Studio and returns what I want, but PHP returns this error:
Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near ')'. (severity 15) in C:\http\l2raven\L2Admin\Char\ListCharacterItem.php on line 57
please help me
Thanks
G-Man