Get Ip Address back from the mysql database with php help?

Blue

New member
$sql_mem_data = mysql_query("SELECT INET_NTOA(last_ip) FROM Users WHERE id=1 LIMIT 1");
if(mysql_num_rows($sql_mem_data) == 0)
{
echo "Invalid User";
}
else
{
$ipoutput = $row["last_ip"];
echo $ipoutput;
}

Whats wrong with this?
I used
$ipaddress = $_SERVER['REMOTE_ADDR'];
mysql_query("UPDATE Users SET last_ip=INET_ATON('$ipaddress') WHERE id=1"); to set it, Its in the database and that part works(Can see it in phpmyadmin) i just can't get the ip address back like it should be.
 
Back
Top