note 65425 added to function.time

From: Date: Sun, 30 Apr 2006 16:27:19 +0000
Subject: note 65425 added to function.time
Groups: php.notes 
Request: Send a blank email to php-notes+get-110194@lists.php.net to get a copy of this message
*Voici un exemple de l'utilisation de time(). *Je mee sert de ce code pour afficher les utilisateurs en ligne. $now = date('Y-m-j H:i:s'); $timel = time($now)-600; //maintenant - 10 minutes // on efface ceux donc le temp de champ time < $timel $query = "DELETE FROM table WHERE TIME(champdatetime) < '$timel'";; $result = mysqli_query($this->conn,$query); // on selectionne ceux qui on un TIME(champdatetime) > que $timel $query = "SELECT * FROM table WHERE TIME(champdatetime) > '$timel' AND lacondition ='vrai'"; $result = mysqli_query($this->conn,$query); $num_result = mysqli_num_rows($result); // on affiche le nombre de resulta donc les cahmp ou TIME(champdatetime) n'est pas plus vieux que $ltime. echo " ".$num_result." le nombre de résulta<br />"; ---- Server IP: 216.235.15.211 Probable Submitter: 72.10.135.143 ---- X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER, HTML_MESSAGE autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.time.php Edit -- http://master.php.net/note/edit/65425 Del: integrated -- http://master.php.net/note/delete/65425/integrated Del: useless -- http://master.php.net/note/delete/65425/useless Del: bad code -- http://master.php.net/note/delete/65425/bad+code Del: spam -- http://master.php.net/note/delete/65425/spam Del: non-english -- http://master.php.net/note/delete/65425/non-english Del: in docs -- http://master.php.net/note/delete/65425/in+docs Del: other reasons-- http://master.php.net/note/delete/65425 Reject -- http://master.php.net/note/reject/65425 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#110194) next »