How Sort data from database in php when using while in php -
i want sort date, time database new old ( high low ) , use code didn't work! can me? , want mysqli solution , uses while because don't know how many numbers of information receive database!
$sql = "select * orders seller='$id' order dtime asc"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { $ordernumber = $row['ordernumber']; echo "<ul> <li> $ordernumber</li></ul>"; } }
if want more details ordering click here.
in code, should write below,
$sql = "select * orders seller='$id' order dtime desc";
and please search ordering doubt.
thanks..!!
Comments
Post a Comment