Forum Moderators: coopster
$ip=$_SERVER['REMOTE_ADDR']; mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
mysql_query("UPDATE $table SET currentIP = $ip WHERE $userid = $_COOKIE['userid']");
And this code isn't seeming to work :/ Any ideas?
you can only use array in a quotation marks if you use {} braces/brackets. but that is not even good considering performance, it increases the time that php to parse the string.
here is the solution
mysql_query("UPDATE $table SET currentIP = $ip WHERE userid =". $_COOKIE['userid']."");
hope that helps you.
[edited by: Mohamed at 10:28 pm (utc) on Aug. 22, 2008]