Jump to content

how to track search phrases


mga_ka_php

Recommended Posts

Do you have a mysql database?  If you do, create a search_phrases table in your database.  Whenever anyone searches, add an entry for their search phrase.  Along with the search phrase, have a count column.  If someone searches for a phrase that already exists in the database, increment the count column.

 

<?php
$query = $_GET['query'];
$query = "SELECT COUNT(*) as total FROM search_phrases WHERE phrase = '". mysql_real_escape_string($query) ."'";
// Im honestly too drunk to finish this code, but if the search phrase exists, increment the count, if it doesnt, insert it into the database.
?>

 

:)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.