I want to match a string var named “$ip” to a column name “ip” in “$Hood” table.
If there isn’t a match then do something.
So I have this code:
if (mysql_query("IF EXISTS(SELECT TOP 1 1 FROM $Hood WHERE ip=$ip)") == 1)
And it’s not working, it suppose to return 1 because there is a match.
What’s wrong here?
simply select the matching ip form the DB like so:
and count the rows, if it is equal to 1 then you have a match, 0 otherwise, like so: