MySQL Call Recent Timestamp in PHP -


i've seen similar types of questions on so, however, have not been able find solution specific issue. want recent timestamp , call in php code. (fyi, these not real columns, shortened example).

my_table

row_1         row_2                  timestamp ======================================================  01              04              2014-06-24 22:00:00  02              01              2014-06-25 19:00:00     03              93              2014-06-27 14:00:00  04              83              2014-06-27 14:31:20 <=== return row (latest time) 

so, want able to:

1) select "newest" row, based on timestamp , 2) select 'row_2' column accordingly timestamp 

any on great.

thanks in advanced!

  select `newest`, `user_2`      `your_table` order `timestamp` desc    limit 1 

the limit 1 there in order fetch 1 set of data.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -