On Mon, 1999-10-04 10:17:33 +0100, Ed Williams wrote:
> I have a MySQL Table full of web referers and want to display the
> last twenty unique visitors unique in the sense of host name the
> only problem is the referer is stored in format like so
> http://www.host.com/webpage.html .When I do a select distinct it
> could return the same host address but with different referering
> Is there a way of doing a REGEXP or somthing to just select
> different hosts. Even worse is that I want a count of how many
> timesthe host has been refered.
You can use something like
SUBSTRING_INDEX(SUBSTRING_INDEX(referer,'//',-1),'/',1) AS host
to access the host part only.
I hope this helps to get you going ...
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=5244 5EF3 B0B1 3826 E4EC 8058 7B31 3AD7