472,141 Members | 1,295 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

Displaying the top 10 search phrases searched for on a site.

117 100+
I am trying to add this to the search page so it shows the users the top 10 items searched for... like this.

Top 10 Searches:
( free, invincible, lvl skip, skin mod, car, toy, controller, sexy, buy)

[PHP]<?php

$sql = "select * from search_terms order by count desc limit 0,10";

$result = mysql_query($sql ,$db);

if ($myrow = mysql_fetch_array($result)) {

do {

printf("<tr>");
printf("<td width=250>%s</td>", $myrow["term"]);
printf("<td width=50>%s</td>", $myrow["count"]);
printf("</tr>");

} while ($myrow = mysql_fetch_array($result));

}


?>[/PHP]

It works but don't seem to update the code, with the new search tems i just posted. I want it to show only the new ones not the old ones!
Sep 8 '07 #1
2 1473
pbmods
5,821 Expert 4TB
Breana, please read the Posting Guidelines regarding what makes a good thread title.
Sep 8 '07 #2
kovik
1,044 Expert 1GB
It works but don't seem to update the code, with the new search tems i just posted. I want it to show only the new ones not the old ones!
That's because you likely have a lot of searches on the older terms, so adding new ones doesn't necessarily mean they have the same amount of searches. You should make some sort of filtering by the date.
Sep 9 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Stephen Ferg | last post: by
67 posts views Thread by Sandy.Pittendrigh | last post: by
83 posts views Thread by D. Dante Lorenso | last post: by
1 post views Thread by Noticedtrends | last post: by
8 posts views Thread by Roman | last post: by
3 posts views Thread by mercuryshipzz | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.