I've added NOT IN so it wont include 21 and 25 when displaying the Knights but I want to add message like clan not found and etc but it will says something else.
if (!isset($_GET['id']))
{
$this->Error('CLAN_NOT_FOUND');
return;
}
$db = $this->database[GDB];
$id = intval($_GET['id']);
$num_rows = $db->doQuery('SELECT IDName FROM KNIGHTS WHERE IDNum = ? AND IDNUM NOT IN (21,25)', $id);
if ($num_rows == -1)
{
$this->Error('DB_ERROR');
$db->getError();
return;
}
else if ($num_rows == 0)
{
$this->Error('CLAN_NOT_FOUND');
return;
}
I've already created CLAN_CANNOT_DISPLAY but I don't know how to include it correctly and securely on the function above. If someone is able to help me out and show me how it should look .. I'll be really grateful.
EDIT: I use MSSQL Server 2005
Kind Regards.
IDNumis a param, why not check!= 21,25within PHP? Why make a round trip to the server?CLAN_CANNOT_DISPLAY?IDNum = ? AND IDNUM, it should beIDNum = ? AND IDNumorIDNUM = ? AND IDNUM, depending on your case.