<?php
$user_id = 1;
// Tüm tweetleri seç
$sql = "SELECT * FROM tweets";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// Her tweet için işlem yap
while($row = $result->fetch_assoc()) {
// Tweetin ID'si
$tweet_id = $row["id"];
// Like tablosundan kullanıcının bu tweet için like yapmış olup olmadığını kontrol et
$sql_likes = "SELECT * FROM likes WHERE tweet_id = $tweet_id AND user_id = $user_id";
$result_likes = $conn->query($sql_likes);
$has_liked = $result_likes->num_rows > 0;
// Retweet'ler tablosundan kullanıcının bu tweet için retweet yapmış olup olmadığını kontrol et
$sql_retweets = "SELECT * FROM retweets WHERE tweet_id = $tweet_id AND user_id = $user_id";
$result_retweets = $conn->query($sql_retweets);
$has_retweeted = $result_retweets->num_rows > 0;
// Yorumlar tablosundan kullanıcının bu tweet için yorum yapmış olup olmadığını kontrol et
$sql_comments = "SELECT * FROM comments WHERE tweet_id = $tweet_id AND user_id = $user_id";
$result_comments = $conn->query($sql_comments);
$has_commented = $result_comments->num_rows > 0;
// Eğer kullanıcı tweet için bir işlem yapmışsa, tweeti listeden kaldır
if ($has_liked && $has_retweeted && $has_commented) {
// Tweeti listeden kaldırma kodu buraya gelecek
}
}
}
?>Bu örnek bir durum bu örnekten yola çıkabilrisin