PDOCrud Order by ascending and descending

You can get the data order by ascending and descending by using dbOrderBy function.

  
                    $pdocrud = new PDOCrud();
                    $pdocrud->dbOrderBy("id desc");//descending    
                    //$pdocrud->dbOrderBy(array("id desc","order_no desc"));//pass in array                                 
                    echo $pdocrud->dbTable("orders")->render();
                        

Orders

Showing 1 to 10 of 79 entries

# ID Order no Order date Customer name Order amount Order status Actions
1 156 1 2019-12-04 ghd 0 cgh
2 155 1 2019-12-04 ghd 0 cgh
3 154 80 2019-12-12 Pepito 5 1
4 153 0 0000-00-00 0
5 152 0 0000-00-00 0
6 151 1 2019-12-11 asdas 0 4343
7 150 1 2019-12-12 vfhr 34 242
8 149 0 0000-00-00 0
9 148 0 0000-00-00 0
10 147 93062 2016-09-08 Cooper Jensen 32 qsdCompleted
# ID Order no Order date Customer name Order amount Order status Actions