sahinbey adlı üyeden alıntı: mesajı görüntüle
İki adet tarih seçebilmek için html tablonun dışında bir yere aşağıdaki html kodunu ekleyin.

<form method="GET">
    <input type="date" name="start_date" value="<?php echo empty($_GET["start_date"]) ? date("Y-m-01") : date("Y-m-d", strtotime($_GET["start_date"])); ?>">
    <input type="date" name="end_date" value="<?php echo empty($_GET["end_date"]) ? date("Y-m-t") : date("Y-m-d", strtotime($_GET["end_date"])); ?>">
    <button>Getir</button>
</form>
HTML inputlardan gelen tarihe göre de php sorgularınızı güncellemeniz gerekiyor,

            <?php
                $start_date = empty($_GET["start_date"]) ? date("Y-m-01") : date("Y-m-d", strtotime($_GET["start_date"]));
                $end_date = empty($_GET["end_date"]) ? date("Y-m-t") : date("Y-m-d", strtotime($_GET["end_date"]));

                $Sor = $conn->prepare("SELECT * FROM yemeklistesi WHERE tarih >= :start_date AND tarih <= :end_date");
                $Sor->execute([
                    "start_date" => $start_date,
                    "end_date" => $end_date
                ]);
                $rows = $Sor->fetchAll(PDO::FETCH_ASSOC);
                foreach ($rows as $row) {
                $id = $row['id'];
                $kullaniciadi = $row['yemek'];
                $sifre = $row['tarih'];
         ?>
        <tr>
            <td><?php echo $row['id']; ?></td>
            <td><?php echo $row['yemek']; ?></td>
            <td><?php echo $row['tarih']; ?></td>
            <td style="background-color: green; color:#fff; font-size:20px;">
                <?php
                    $bilgiler = $conn->prepare("SELECT * FROM yemekhane_anket WHERE tarih >= :start_date AND tarih <= :end_date");
                    $bilgiler->execute([
                        "start_date" => $start_date,
                        "end_date" => $end_date
                    ]);
                    $bilgilercek=$bilgiler->fetchAll(PDO::FETCH_ASSOC);
                        $say = 0;
                        $mem = 0;
                        foreach ($bilgilercek as $row2) {
                        $a = strtotime($row2['tarih']);
                        if(strval($row['tarih']) == strval(date('Y-m-d',$a))){
                            $say = $say + 1;
                        }
                        if(strval($row['tarih']) == strval(date('Y-m-d',$a)) && strval($row2['memnuniyet_durumu']) == '1'){
                            $mem = $mem + 1;
                        }
                        }
                        if (strval($say) == '0') {
                            echo 'Değerlendirme Yapılmamış';
                        } else{
                            echo round(intval($mem) * 100/intval($say));
                            echo "%";
                        }
                    ?>
            </td>
        </tr>
       <?php }
        ?>
    </tbody>
</table>
Müthiş
İlginiz için teşekkür ederim.