Jump to content

SQL TABLE PROBLEM


rajaahsan

Recommended Posts

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 ?

 

Link to comment
Share on other sites

no boss,  i have already auto increment checked in database on my primary key which is "id" but problem remains the same why is it happening as my data successfully been saved but only sequence problem distirb me please help guyz..

Link to comment
Share on other sites

it's impossabe to tell from the information given if the sequencing is off on entry or return.  MySQL does not automaticly return information in a set order, you need to use the "order by" clause for that - Try appending ORDER BY id at the end of the SELECT query and see what happens.

if that is what his table looks like then the data is being inserted that way...I had a similar problem before but it was due to the fact that i thought that I had auto-increment on when in fact i didnt..this has me confused

Link to comment
Share on other sites

if that is what his table looks like then the data is being inserted that way...I had a similar problem before but it was due to the fact that i thought that I had auto-increment on when in fact i didnt..this has me confused

 

As data is fetched asyncronously by MySQL, the id field is indead contiguious, the OP said that the column was deffinately auto_inc and the example dataset shows no indication of entry timestamping: I stand by (probably in complete error, but in the absence of a better idea) the issue being with select returning the data without a fixed order being declared.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.