Answer the question
In order to leave comments, you need to log in
The problem with auto increment, what could be the problem?
Hello, when I add an ID to a table and do auto increment on it, then my data stops being written to the database after authorization, what could be the problem?
Here is the code, initially when the table without auto increment everything works fine
$ipcountry = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip)) -> {'geoplugin_countryName'};
if (empty($ipcountry)) {$ipcountry = 'XX';}
$SQL = $odb -> prepare('INSERT INTO `loginlogs` VALUES(:username, :ip, UNIX_TIMESTAMP(), :ipcountry)');
$SQL -> execute(array(':ip' => $ip, ':username' => $username, ':ipcountry' => $ipcountry));
Answer the question
In order to leave comments, you need to log in
Everything I did used the null value
$SQL = $odb -> prepare('INSERT INTO `loginlogs` VALUES(NULL, :username, :ip, UNIX_TIMESTAMP(), :ipcountry)');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question