I tried it by running the the query inside the SQL and by echo the variables in the browser they are very same but when comparing its returning false . Only for $tteam1 ==$tres