View search queries

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

View search queries

Post by spamyboy »

My client requested "View search queries" ability, recording all maden queries would be stupid - any sugestions ?
Or maybe you have some premade stuff that would fit this.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

What exactly is "View search queries"
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Do some regex on the referrer.
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

Jcart wrote:What exactly is "View search queries"
I wish I would knew what did he waned, probaly he waned to see most serachable titles (website is about lyrics), this plugin (as I think) should probaly show / start counting for e.g. only those queries that were entered atleast 10 time or it could basicly show last 20 search queries - have you guys never done such things before ?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Certain hosts (such as GoDaddy) do it for you. Like I said, just parse it from the referrer URL. Search queries are (typically) sent through the URL.
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Post by spamyboy »

superdezign wrote:Certain hosts (such as GoDaddy) do it for you. Like I said, just parse it from the referrer URL. Search queries are (typically) sent through the URL.
I were talking more like about local website seacrh...
Baisicly he want's to look what lyrics peoples are looking in his website.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Oh. And you want to record the frequency?

Assuming you have full access to the queries, you could do something along the lines of this for each word (database-wise):

Code: Select all

REPLACE `queries` (`word`, `freq`) VALUES ('$word', `freq` + 1);
I think if you give the frequency column a default value of 0, that should work.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

spamyboy wrote:
Jcart wrote:What exactly is "View search queries"
I wish I would knew what did he waned, probaly he waned to see most serachable titles (website is about lyrics), this plugin (as I think) should probaly show / start counting for e.g. only those queries that were entered atleast 10 time or it could basicly show last 20 search queries - have you guys never done such things before ?
I would consider this a big problem... if you don't know what he wants there is a lack of a communication, and possibly a product he is not happy with.
Post Reply