Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $result = $conpdo->prepare("SELECT * FROM `logs` WHERE `username` LIKE :username");
- $result->execute(array(':username' => $_GET['username']));
- $info = $result->fetch(PDO::FETCH_ASSOC);
- if(empty($info))
- {
- $result = $conpdo->prepare("INSERT INTO `logs` (`id`, `ip`, `username`, `last_update`) VALUES (NULL, :ip, :username, '0000-00-00 00:00:00');");
- $result->execute(array(':username' => $_GET['username'], ':ip' => $_GET['ip']));
- }
- else
- {
- $result = $conpdo->prepare("UPDATE `logs` SET `ip` = :ip WHERE `logs`.`id` = :id");
- $result->execute(array(':ip' => $_GET['ip'], ':id' => $info['id']));
- }
Add Comment
Please, Sign In to add comment