I have a basic write to and retrieve sql database php \"thing\" and I want to have the output in descending order. How do I do that?
Eg. last entry is shown first,
MySQL General Query Syntax for Select:
SELECT field1, field2,...fieldN FROM table_name
[WHERE Clause][GROUP BY]
[ORDER BY][LIMIT]
Example Query 1:
SELECT id,first_name,last_name,email FROM users ORDER BY first_name desc// In this case you can only fetch data by = id,first_name,last_name,email
Example Query 2:
SELECT * FROM users ORDER BY first_name desc // In this case all fields will be selected
Note: ORDER BY ASC = Data will sort by Ascending Order & ORDER BY DESC = Data will sort by descending Order