SELECT * FROM (
SELECT username, pass,status from co
UNION SELECT username, pass,status FROM student
UNION SELECT username, pass,status FROM teacher
UNION SELECT username, pass,status FROM staff ) as a WHERE username = "****" and pass = "***"
$strSQL = "SELECT * FROM (SELECT username, pass,status from co
UNION SELECT username, pass,status FROM student
UNION SELECT username, pass,status FROM teacher
UNION SELECT username, pass,status FROM staff
) as a WHERE username = $username and pass = $password ";