You are here: Re: Distinct down « PHP Programming Language « IT news, forums, messages
Re: Distinct down

Posted by Jerry Stuckle on 06/16/07 21:02

Gandalf wrote:
> 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
>

First of all, this is not a PHP question - it's a database question.
You should be asking in a database-related newsgroup.

Second, as Michael indicated, you need something to sort on. If you
don't store a timestamp or something relating to when the user signs on,
you have nothing to sort on.

I'd suggest you follow up in the appropriate newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация