Advertisement

08.22.2008 at 03:27PM PDT, ID: 23671671 | Points: 500
[x]
Attachment Details

PHP to calculate Top 10 and daily change in position.

Asked by UltraFlux in PHP and Databases, MySQL Server

Tags: ,

- I'd like to be able to run each night to calculate the Top 10.
- I'd like to show the increase or decrease in position compared to the last day

I think this is similar to how music Top 10 works. For instance last week Song X was in 5th and this week Song X is in 3rd +2 positions.

The code I've attached allows me to list the top keywords, I need help expanding on this to incorporate the details above.

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
$q = "SELECT keyword, COUNT(id) AS quantity FROM search GROUP BY keyword ORDER BY quantity";
$r = mysql_query($q);
	
while ($row1 = mysql_fetch_array($r)) {
  tags[$row1['keyword']] = $row1['quantity'];
}
 
arsort($tags);
 
Loading Advertisement...
 
[+][-]08.22.2008 at 04:52PM PDT, ID: 22294992

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.22.2008 at 04:54PM PDT, ID: 22294995

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.23.2008 at 11:52AM PDT, ID: 22298056

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628