query("SELECT count(*) as count FROM sprueche;"); $row = $rows->fetchArray(); $numRows = $row["count"]; if ($zufall == ""){ $zufall = mt_rand(1,$numRows); } $safe_zufall = SQLite3::escapeString("$zufall"); $ergebnis = $db->query("SELECT * FROM sprueche where id=$safe_zufall;"); echo"

JUNGE GEMEINDE ADLERSHOF




Zitat Nummer #$zufall

"; if (preg_match('/[0-9]/',$zufall)){ // I really need this hack to get the 404 when /[0-9][a-zA-Z]/ is happening. Bad PHP! if (preg_match('/[^0-9]/',$zufall)){ $zufall = 0; } } if ($zufall > 0 && $zufall <= ($numRows)){ while($row=$ergebnis->fetchArray()){ echo $row["spruch"]; } } else { echo "\"Sorry, can't find the quote, but a cat is fine too, right?\"

      ,/|         _.--''^``-...___.._.,;
     /, \'.     _-'          ,--,,,--'''
    { \    `_-''       '    /}          
     `;;'            ;   ; ;            
 ._.--''     ._,,, _..'  .;.'           
  (,_....----'''     (,..--''           


404 - Eintrag nicht vorhanden. "; } echo "



-----------------------------------------------------------------

Es sind momentan $numRows Zitate in der Datenbank enthalten.

Du suchst ein bestimmtes Zitat? Gib hier dessen Nummer ein:
"; }