1

Currently my database is pretty messed up. The id's are not listed properly. I want them to be listed down permanently from 1 to 10. How do I do that? I want them listed from 1 to 10 permanently. Not just with

SELECT * FROM `accounts` ORDER BY `accounts`.`id` ASC

http://prntscr.com/chu0nk

Dani
  • 364
  • 1
  • 11
  • [ORDER BY](http://dev.mysql.com/doc/refman/5.7/en/sorting-rows.html)? Or just click on ID in phpMyAdmin? – Ocaso Protal Sep 14 '16 at 09:12
  • Make the ID field uniq and auto increment if that did not solve it just press that little 'id' link with your left mouse click. phpmyadmin shuld order them when you press it. – xttrust Sep 14 '16 at 09:13
  • It is. Somehow phpmyadmin mixed it up. – Dani Sep 14 '16 at 09:14
  • You can use a SQL query to query all order by id: SELECT * FROM table ORDER BY id ASC – xttrust Sep 14 '16 at 09:15

1 Answers1

1

I know it's a process but you can make it this way first use this query to get data in order by id select * from accounts order by id asc and insert the data in a dummy table and then just replicate the data of dummy table in your original table i.e. accounts

hope this will work for you

Manoj Gupta
  • 63
  • 1
  • 1
  • 9