Using the min()function with mySQL permits developers to sort through a database and retrieve the lowest value. With date, the lowest value would be the earliest date entered for a specific column. The example below shows how to get the earliest date from a table where the user is the administrator.
$command = "SELECT min(date) as date FROM tablename WHERE date < now() and user='admin' "; $result = mysqli_query($db, $command); while ($row = mysqli_fetch_assoc($result)) { $date = $row['date']; //echo $date; }
© 2018 ALL Rights Reserved | Sitemap
Vancouver | North Vancouver | Burnaby | Richmond | Coquitlam | Port Coquitlam | Surrey | Langley | Maple Ridge | Mission | Abbotsford | Kamloops | Kelowna | Victoria | Squamish | Whistler | Pemberton