Why wont this SQL Query work?
Basically, when someone logs in I am trying to grab the IP, and then insert it in to the database..
This is the code I have, Its not giving any errors but nothing is being inserted into the database..
PHP Code:
<?php
include("config.php");
$ip = $_SERVER["REMOTE_ADDR"];
$username = mysql_escape_string($_SESSION["username"]);
mysql_query("UPDATE ip FROM `users` SET IP = '$ip' WHERE user='$username'");
}
?>
Probably something simple, Never tried grabbing the IP and putting it in a database before though.
Moved by Samm (Forum Moderator): From "Technology Discussion" as it is better suited here :)