Sorry, mit "er" meine ich, meinen Code.
Hier ist der in ganze Code:
if($_SESSION['id'] !== $uid) {
if($sl = $pdo->prepare("
SELECT
*
FROM profil_aufrufe WHERE user_id = :id AND aufrufer_id = :user_id AND date < DATE_SUB(CURDATE(), INTERVAL 1 MINUTE) ORDER BY DATE DESC LIMIT 1;")) {
$sl->BindParam(':id', $uid);
$sl->BindParam(':user_id', $_SESSION['id']);
if(!$sl->execute()) {
print_r($sl->errorInfo());
}
$count_exists = $sl->rowCount();
$sluser = $sl->fetch();
}
if($count_exists > 0) {
if($aufruf = $pdo->prepare("
INSERT INTO profil_aufrufe (user_id, aufrufer_id)
SELECT :user, :aufrufer
FROM user
WHERE EXISTS (
SELECT id FROM user
WHERE id = :user) LIMIT 1;")) {
$aufruf->BindParam(':user', $uid);
$aufruf->BindParam(':aufrufer', $_SESSION['id']);
if(!$aufruf->execute()) {
print_r($aufruf->errorInfo());
}
}
}
}