I have question, I want to insert new row to db (mysql) using php and I need to add it to first place in table, but it comes to last position.
I need to short it like this:
3
2
1
but it shorts like
1
2
3
Can you help me please?
Thanks a lot, Stepan
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming that you are using an incremental ID as the unique key, you can do:
if not, you can add a column to the DB called “created” which would be a datetime that you set to NOW() when you create the row. Then you would do: