Page 1 of 1

SQL TABLE PROBLEM

Posted: Mon May 30, 2011 3:35 pm
by shinstar
HY every one , i am having problem with my phpmysql database , i save different values form form but when i save multi values at a time the values saved in database successfully but the sequence of my praimary id changes , e.g

id firstname lastname dob
1 abc abc abc
3 abc abc abc
2 abc abc abc
4 abc abc abc
5 abc abc abc

so own but as you see 2 must be before the value 3 so any one tell me what is the problem in database ?

Re: SQL TABLE PROBLEM

Posted: Tue May 31, 2011 9:19 am
by Celauran
ORDER BY id ASC

No problem.

Re: SQL TABLE PROBLEM

Posted: Tue May 31, 2011 8:43 pm
by califdon
Fundamental characteristic of all relational databases: there is no defined sequence of rows. If you want to extract data in a particular sequence, you must always use the ORDER BY clause of your query.