★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum5/HTML/000957.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  PHP
  counting and sorting .. :)

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   counting and sorting .. :)
closecut
Member
posted April 25, 2000 05:13 AM     Click Here to See the Profile for closecut   Click Here to Email closecut     Edit/Delete Message Reply w/Quote
I have a database-table that stores information on refering urls to a site.

Each referer is stored like:
"http://www.theengine.com/search/search.php?q=Visitors+Query" (bogus-url, searchengines look pretty much like this)
and
"http://www.directory.com/Cat_1/Cat_2/Cat_3" (bogus-url, directories look pretty much like this)

Every time a referer is stored, it's flagged as being "U" (unknown), and if i don't get a url, it's flagged as "Sp" (spider - which is not always the case, but if it isn't referred, i don't want it in my stats). When i fire up my report-script, all entries marked as "U" gets compared with known directories (in separate table) and known searchengines (also in a separate table), and if i get a match in the directory-table, it gets reflagged as "D" and if it's in the searchengine-table, it gets reflagged as "S", otherwise it stays as "U".

i use parse_url() to get the url, like:
$my_url = parse_url($result[0]);

and then i match $my_url["host"] against the tables with something like this:
$my_host = $my_url["host"];
$my_query = "
SELECT searchengine_id FROM Searchengine
WHERE searchengine_url LIKE '%$my_host%'";
$my_result = mysql_query($my_query)
or die("- Couldn't perform:<br><b>$my_query</b><br><br>");

and then i reflag it in the table containing the referers.

Now i need to extract the keywords from all referers flagged as "S"... i know that $my_url["query"] contains the query part from the referring url, but what i need to do is take _each_ keyword and match it against other entries in the referer-table flagged with the "S", and count the number of referers containing that specific keyword, store the keyword and count in an array, and move on to the next keyword, repeat the procedure for all "S"-flagged entries, and make sure i don't count the same keyword several times ...

Any ideas anyone? I'm getting confused ..

------------------

quote:
Linux, the operating system with a clue - Command Line User Environment.

geeee... thanks!

/closecut

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.