|
Posted by Gandalf on 06/16/07 20:38
On Jun 16, 8:37 pm, Michael Fesser <neti...@gmx.de> wrote:
> .oO(Gandalf)
>
> >On Jun 16, 5:23 pm, Gandalf <goldn...@gmail.com> wrote:
>
> >I feel like I need to explain it more clearly.
>
> >Like the last users that watch my card in a date site. I wont that if
> >I entered both month ago and second ago the query steel pull me as the
> >last user that entered the card
>
> Still confusing, but do you want to get the last entry from a database
> table? Then you have to implement something to get the records in a
> specific order (database records don't have any specific order by
> default), for example the date when the record was inserted or updated.
> Then sorting by date and fetching the last record is trivial.
>
> Micha
When user enter other user card there's a registry of the both user's
id and the auto increment number that uses as row id.
Now when I write this query :
"select distinct visit from `last_users` where host='$_REQUEST[num]'
order by id desc limit 10"
I get the last 10 users that visit the host card only if it's their
first time to visit him. otherwise the query consider there first
entry as the unique row.
I hope I explained it better now.
thank you
Navigation:
[Reply to this message]
|