Einzelnen Beitrag anzeigen
  #31  
Alt 28.11.2004, 13:29:42
Benutzerbild von xabbuh
xabbuh xabbuh ist offline
SELFPHP Guru
 
Registriert seit: May 2003
Beiträge: 7.187
Erweitern wir die Abfrage noch:
PHP-Code:
<?php
    $sql 
"SELECT
                COUNT(id) AS amount
            FROM
                tabelle
            WHERE
                (date_from <= '{$timestamp_date_from}'  AND
                date_to    >= '{$timestamp_date_from}') OR
                (date_from <= '{$timestamp_date_to}'    AND
                date_to    >= '{$timestamp_date_to}')   OR
                (date_from > '{$timestamp_date_from}'   AND
                date_to < '{$timestamp_date_to}')"
;
?>
Mit Zitat antworten