-1

the if statement is not showing correct, it is always showing true even is is wrong.

$sql ="SELECT * FROM `namemap` WHERE `info_hash`=='{$_GET['info_hash']}'";
if ( $sql == true )
{errorexit(`error`);
}
Sumner Evans
  • 8,951
  • 5
  • 30
  • 47

1 Answers1

1

Your $sql variable is just a string, you never execute a query which I assume you wish to do. A string always evaluates to true.

purpleninja
  • 376
  • 3
  • 11
  • $query = @mysql_query("SELECT info_hash FROM namemap where info_hash = {$_GET['info_hash']}"); $result = @mysql_query($query) or die ("Error in query: $query " . mysql_error()); if (mysql_num_rows($result) > 0 ) { errorexit('error'); } it is still same – user3657176 Mar 06 '16 at 23:04