I would like to have a separate table in Database to store visits & clicks of
different Users or Pages using a "id".
I embedded the following in index.html to push the "id" into script:
<script type="text/javascript">id=101;</script>
<script src="http://www.abc.com/thesaurus/jquery.thesaurus.js"></script>
If i would edit the db.php as follows to count clicks and visits also in table
user, how could i pass the "var id" trough the different scripts to access and
use it in db.php?
public function incrementClickStat($term) {
mysql_query("UPDATE thesaurus SET clicked=clicked+1 WHERE term LIKE '{$term}'");
mysql_query("UPDATE user SET clicked=clicked+1 WHERE id='{$id}'");
mysql_query("UPDATE user SET clicked=clicked-3");
}
public function findDefinition($term, $caseSentitive) {
if($caseSentitive) {
result = mysql_query("SELECT term, description FROM thesaurus WHERE
term='{$term}'");
mysql_query("UPDATE thesaurus SET visited=visited+1 WHERE term='{$term}'");
mysql_query("UPDATE user SET visited=visited+1 WHERE id='{$id}'");
} else {
$result = mysql_query("SELECT term, description FROM thesaurus WHERE term LIKE
'{$term}'");
mysql_query("UPDATE thesaurus SET visited=visited+1 WHERE term LIKE '{$term}'");
mysql_query("UPDATE user SET visited=visited+1 WHERE id='{$id}'");
Original issue reported on code.google.com by upps2...@googlemail.com on 12 Feb 2011 at 2:14
Original issue reported on code.google.com by
upps2...@googlemail.com
on 12 Feb 2011 at 2:14