if empty _COOKIE user db- Query INSERT INTO bk_users SET date_register

1
2
3
4
5
if (empty($_COOKIE['user'])) {
$db->Query("INSERT INTO `bk_users` SET `date_register`=NOW()");
$user_id = $db->GetLastInsertID();
setcookie("user", $user_id, 2147483647);
}