Each time you login a table is populated with the following: userid, time, ip, sid. Now I want to show the last time the person logged in. So my query will search my table for that person’s userid with LIMIT 2, now how to I grab the second row found? I looked on php.net and didn’t see any mysql functions that fit my criteria.
I’m also trying to rank the user. I query'd the table and searched credits DESC, now how do I find the users row thus showing his/her rank?
Thanks.
SQL query help
Moderator: General Moderators
Code: Select all
select * from my_table where user_id = 2 order by fld_time desc limit 1,1