I am trying to store the user's ip address in a mysql table.
The tables name is logins and the collumn I want the ip to go in it loginip. The column that has the users username is username and the time the user signs up goes in login.
Now, I had this code when I just added user name and time and it worked:
$logintime = "INSERT INTO logins SET
username = '$username',
login = Now()";
But, I tried to store the ip of the user and it messed up:
$theip = $_SERVER['REMOTE_ADDR'];
$logintime = "INSERT INTO logins SET
username = '$username',
login = Now(),
loginip = $theip";
When I did that code, it doesn't even record the time.
Any ideas?
Thanks