Hello.
i have this code bellow wich inserts a users ip adress into my database but i have a problem. the code right now works, but when it inserts the ip adress is just get’s the first numbers… like if it is for example 127.0.0.1 it only takes 127 into the database and not the rest, why is this?
[code=php]
<?php
include(‘other/config.php’);
mysql_connect($host, $dbname, $dbpass) or die(mysql_error());
mysql_select_db($dbuser) or die(mysql_error());
$ip_address = $_SERVER[‘REMOTE_ADDR’];
$process = mysql_query(“INSERT INTO `stats` (`ip`, `views`) VALUES (‘”.mysql_real_escape_string($ip_address).”‘, 1) ON DUPLICATE KEY UPDATE `views` = `views` + 1″) or die(mysql_error());
?>