Im trying to pass two variables into a mysql query, and its getting stuck when passing the session variable in below:
$check = mysql_query("SELECT *
WHERE Username = '$new_username'
AND Username != '$_SESSION['Username']'") or die(mysql_error());
It is because your single quotes
'$_SESSION['Username']' have been ended by the value in the session. Changing this to
'" . $_SESSION['Username'] . "' will solve the problem.