retrieve the last record???

Reply

Join Date: Sep 2009
Posts: 108
Reputation: jrosh is an unknown quantity at this point 
Solved Threads: 0
jrosh jrosh is offline Offline
Junior Poster

retrieve the last record???

 
0
  #1
Oct 2nd, 2009
How to write a query to retrieve the last record that is entered. ???
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 188
Reputation: jbisono is an unknown quantity at this point 
Solved Threads: 24
jbisono's Avatar
jbisono jbisono is offline Offline
Junior Poster

Re: retrieve the last record???

 
1
  #2
Oct 2nd, 2009
I do not know if this can help you, but if you have a date field which you can order by desc, then you can use Top 1 something like this.

  1. SELECT top 1 Field1
  2. FROM table1
  3. ORDER BY datefield desc

if you dont have a date maybe have a index field that is the easiest way to do that.
regards
If your already resolved your issue, flag it as solved.
José Bisonó
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 284
Reputation: SKANK!!!!! is an unknown quantity at this point 
Solved Threads: 2
SKANK!!!!! SKANK!!!!! is offline Offline
Posting Whiz in Training

Re: retrieve the last record???

 
-2
  #3
Oct 5th, 2009
no u just have an id column that auto increments then ur like mysql_query("SELECT MAX(id) FROM table or something
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 62
Reputation: kylegetson is an unknown quantity at this point 
Solved Threads: 9
kylegetson's Avatar
kylegetson kylegetson is offline Offline
Junior Poster in Training
 
0
  #4
Oct 5th, 2009
if you have an auto increment field, just use mysql_insert_id() to get the last auto increment
Don't pay data charges. txtFeeder.com is a free way to read the web on your mobile, and avoid data charges! **Now txtFeeder has a wireless note feature! Make notes on the go!
-Kyle Getson
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC