I have a code which retrieves the values from data base.but i want to fetch this values in reverse order.See this example
While($row=mysql_fetch_assoc($rs)){
echo $row['id']."<br>";//gives 1 and 2 and so on
echo $row['val']."<br>";// gives abc and def and so on
}
But i want
2
def
1
abc
How could i do this .i don’t wanna use the Query for this like use of ORDER BY.so can i control this at PHP End??
Haven’t tested it though
I tested it in this site and it works. Here’s the snippet I used:
Edit:
Using your edited answer, I got this:
$data = array(1 => array(1, “abc”), 2 => array(2, “def”));