Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sequences of records

Status
Not open for further replies.

iffoiffy

Programmer
Feb 24, 2005
67
CA
Hi,

I have a table with primary key name "product_id" with values for primary

snp1
snp2
snp3
...
snp12


Using phpadmin when i insert a record last record inserted comes at the the last (bottom)


I have another table with same primary key name

but when i insert a record (snp12) something like this happens

snp1
snp12
snp2
snp4
snp5

snp12 instead of going at the end gets inserted after snp1

I don't know why?

Thanks
 
thanks, I want the record I enter at the last to appear at te top when I do query. Even if i do "order by product_id desc"


snp9 comes before snp12
I think i will have to add one timestamp field only then

I can have last record apprear at the top.




 
But think about creating a integer field with autoincrement and put primary index on it

or you can try to trick the query with LPAD and SUBSTRING

gry online
 
i think I will create auto ,but still maintain primary key as product_id.

table already has data in it if I add auto field, it will not case any problem right?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top