$result = mysql_query('SELECT * FROM `'. $_CONFIG['mysql']['tbname'] .'` WHERE `'. $_CONFIG['mysql']['field_username'] .'`=\'' . mysql_real_escape_string($request['Ref1']) . '\' LIMIT 1') or die(mysql_error());
$result = mysql_query('SELECT * FROM `'. $_CONFIG['mysql']['tbname'] .'` WHERE `'. $_CONFIG['mysql']['field_username'] .'`=\'' . mysql_real_escape_string($request['Ref1']) . '\' AND id='\'.$_CONFIG['mysql']['tbnameid'].'\' AND email='\'.$_CONFIG['mysql']['field_username'].'\' LIMIT 1') or die(mysql_error());
สรุปแค่เพิ่มเงื่อนไขการตรวจสอบครับ
AND id='\'.$_CONFIG['mysql']['tbnameid'].'\' AND email='\'.$_CONFIG['mysql']['field_username'].'\'