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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -