I have to pass an IP address as a variable in one of my SQL statements.
When i type the IP address in directly 199.222.333.444 it works perfectly.
$result = mysql_query("SELECT * FROM VOTES WHERE IPNUMBER = '199.222.333.444'",$db)
but when i try to use a variable it wont work...
$result = mysql_query("SELECT * FROM VOTES WHERE IPNUMBER = '$domain'",$db);
I've tried every combination of single and double quotes around $domain....i've even compared the variable $domain directly to the 199.222.333.444 and it returned that they were equal.
I've spent 3 days at this and i have no idea what more i can do. I got the IP address using the following call which seems to work fine and when i echo it to the screen it is correct.
$domain = GetHostByName ($REMOTE_ADDR);
i'd be very grateful for any help or ideas on how they might be different...could there be an invisible character somewhere that i'm missing?
Thanks.