grab last row only in ascending results [RESOLVED]
I have a query I am running in Mysql that gets all notes and prints them on the page with the most recent note at the bottom of the page. So it goes from Date Added acending as you scroll down.
But at the very top of the page I have additional info and would like to print the latest note at the very top of the page. Just this one note so if they do not want to scroll down to read all the notes and are there to only read the latest note, it is at the top by itself.
Now I know I can call the same exact query as I do for the notes lower on the page but say order by dateadded desc limit 1. But I was hoping that instead, I could just grab the very last row from the result set I got in the notes query, print the note and then call @mysql_data_seek($result,0); to reset the result and then loop through my notes at the bottom to display all the notes.
So my question to you is this, is there a way to grab the last row from a query result by using mysql_num_rows() or something to get the last result in the array?
Thanks for any help with this. If I have to, I will just write another query.
Last edited by tripwater; 11-14-2006 at 04:05 PM..