PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I do a SQL query and normally just do a "while ($data = mysql_fetch_array($sql))" and echo the output.
What I want to do now is to sort the array before outputting the data, to get it in the correct order. I cannot just sort the data in the SQL query as I have to sort a column containing data in the format of "Firstname1 Lastname1 and Firstname2 Lastname2" and the sorting for that column has to be sorted by Lastname1 ASC.
I figure this is somehow done using a sort array command but I am very lost on how to do achieve this kind of sorting. Any ideas?
I have to sort a column containing data in the format of "Firstname1 Lastname1 and Firstname2 Lastname2" and the sorting for that column has to be sorted by Lastname1 ASC.
Why do you store structured data in only one field if you need access to one of its elements?