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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php/mysql timestamp queries

Status
Not open for further replies.

birdieserver

Programmer
Aug 3, 2005
3
GB
hi, does anyone know how to set variables to the newest added result in a table (table has timestamps)? ive tryed my own script but this is the furthest i could get..

$page1 = mysql_query("SELECT * FROM extrapages ORDER BY time_stamp_col DESC LIMIT 5");

I'm aware that this sets 5 of the results to one variable; is there any simple way to narrow it down so you can have 5 seperate variables which each have one different result.
Any ideas? thanks
 
>>hi, does anyone know how to set variables to the newest added result

have an id to that row and use it?

for reading auto generated ids there is a mysql_last_insert_id() method...

Known is handfull, Unknown is worldfull
 
ive researched the mysql_last_insert_id() function and i cant even find any info on it on php.net. could you please tell me how to basically use it?
 
oops, sorry for the blooper...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top