In mysql extended version, <>
gives out error. You are using mysql_query
Eventually, you have to use extended version of my mysql. Old will be replaced in future browser. Rather use something like
$con = mysqli_connect("host", "username", "password", "databaseName");
mysqli_query($con, "select orderid != 650");