What I want to ask is how to select from database record and my php code able to sort previous date by date,which is what i want to display in my interface:
the code you need is a very simple one.
you just have to understand the meaning of the loop and "remember" state between iterations
//a variable to remember the old date
$olddate = '';
//i named this variable $sql because it actually contains an sql query
$sql = "SELECT date FROM staff WHERE date < '$Current'";
//I named this variable $res because it actually contains NOT sql query, but mysql RESource.
$res = mysql_query($sql) or treigger_error(mysql_error()." ".$sql);
//I named this variable $row because it actually represents a row from the database.
while($row=mysql_fetch_array($res)) {
if ($olddate and $olddate != $row['date']) {
echo "something here";
}
echo $row['date'];
$olddate = $row['date'];
}