Page 1 of 1
how to use this query.
Posted: Fri Jun 22, 2007 3:09 am
by spamyboy
Code: Select all
ON DUPLICATE ENTRY UPDATE `freq`=`freq`+1
How to use it with:
Code: Select all
$keyword=mysql_query("INSERT INTO `search_queries` (`query`, `freq`) VALUES ('$keyword', `freq`)")or die("Insert Error: ".mysql_error());
Posted: Fri Jun 22, 2007 3:15 am
by spamyboy
got it:
Code: Select all
$keyword=mysql_query("INSERT INTO `search_queries` (`query`, `freq`) VALUES ('$keyword', `freq`) ON DUPLICATE KEY UPDATE `freq` = `freq` + 1")or die("Insert Error: ".mysql_error());
Posted: Fri Jun 22, 2007 3:28 am
by John Cartwright
Why did this require a new thread?
Posted: Fri Jun 22, 2007 3:30 am
by spamyboy
The problem was that I wasnt able to find nothing about
query in mysql and basicly it showed up that man who told me it was wrong - he ment KEY.