For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > March 2007 > Re: [PHP-DB] Re: do not display dublicated entries









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] Re: do not display dublicated entries
Niel Archer

2007-03-14, 6:58 pm

Hi

> I have tried everything except of the one that forms the date in one field
> and use the DISTINCT for ip and date.


It works for me. I use it for essentially the same job, listing most
recent visit to a location (not IP, but physical venue).

Have you tried adapting it to your needs, such as:
$query = "SELECT DISTINCT ip, day, month, year FROM tracker WHERE page = 'index' ORDER
BY `tracker`.`year` DESC , `tracker`.`month` DESC , `tracker`.`day` DESC LIMIT 0, 20";


Niel
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com