I'm trying to put an ip-address in my database. If I do an echo like this:
echo $_SERVER['REMOTE_ADDR'];
But if I'm trying to put it in a variable or in the database it gives nothing, so in my database it says: NULL The commands I used for that:
$ip = $_SERVER['REMOTE_ADDR'];
mysql_query("UPDATE users SET last_ip='".$ip."' WHERE id=".$row['id']) or die(mysql_error());
I don't know what I'm doing wrong. Can someone help me with this please?
Thanks!