Jump to content


Photo

retrieving the position of the row inserted.


  • Please log in to reply
2 replies to this topic

#1 Whaih

Whaih
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 February 2006 - 08:12 AM

I have a problem:

I have inserted a row into the database. And now i have them organise in asc order to my preference.
Now i would like to retrieve the position of that row that i inserted a while ago.

E.g. There are 100 records, the row that i inserted is in the no.69 position after i order them in asc order.
How am i able to code it to know that the row is in that position?

Note: using autonumber (id) is out of the question because i have asc them in a way that whenever there is a new record insert, the position will change.

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 27 February 2006 - 09:59 AM

Why can't you let the database do its stuff and just store the information. Do the sorting via any query to retrieve the data.

It seems a very unuseful situation to have to sort the database all the time when as far as it is concerned it cares not a jot where things are!!!
follow me on twitter @PHPsycho

#3 Whaih

Whaih
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 February 2006 - 10:36 AM

[!--quoteo(post=349789:date=Feb 27 2006, 05:59 PM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Feb 27 2006, 05:59 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Why can't you let the database do its stuff and just store the information. Do the sorting via any query to retrieve the data.

It seems a very unuseful situation to have to sort the database all the time when as far as it is concerned it cares not a jot where things are!!!
[/quote]


Hmmm, i'm doing an application to know the position of the runner base on the timing inserted. That's y i need to know where is the row inserted




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users