It means sort the student based on their marks, ‘DESC’ means students with the lowest marks first, while ‘ASC’ means students with the highest marks first.
Apply this code:
<?php include 'dbconnect.php'; // connect your database page $select_query = mysqli_query($con,"SELECT * FROM my_table_name ORDER BY marks DESC"); $row = mysqli_fetch_assoc($select_query); print_r($row); ?>
Or try it:
<?php include 'dbconnect.php'; // connect your database page $select_query = mysqli_query($con,"SELECT * FROM my_table_name ORDER BY marks ASC"); $row = mysqli_fetch_assoc($select_query); print_r($row); ?>
Question and answer is powered by AnsPress.io