The error is usually because of a problem in the sql.
$sql = 'SELECT `Status` , `Site` , `Domain` , `Username` , `Password` , `Email` , `Notes`'
. ' FROM `tblapp` '
. ' WHERE `ApplicationID`='.$AppID.' AND `Status` '
. ' LIKE 'Applying' LIMIT 0, 30';
My guess would be that last line. The single quotes around Applying would need to be slashed if that's static, but if it's supposed to be a variable, you're missing the $. Either way, you shouldn't use like, you should use =. Like is for wildcard matches and degrades performance when a straight equal comparison is used.