Hey, first I will kinda explain what this script is supposed to do.
right now it is very small but im sure I will have to make it a little bigger to do what I want.
What I want it to do is this --
People will search for a keyword using our search engine. That keyword will then go into a mysql database. If it is the first time that term has been searched for it will get the value 1 in the quantity field. Each time it is searched for the value will go up.
I have another program that will display the top 5 terms searched which is working fine.
But this program is just supposed to add the search term to the database and keep upping the quantity by 1 each time it is searched for.
Right now the only thing this will do is add the search term to my database.
How can I get it to check the current value and up it by 1.
Thanks
<?
$quantity = 1;
mysql_connect("","l","");
mysql_select_db("");
$result=MYSQL_QUERY("INSERT INTO stats (word,quantity)".
"VALUES ('$q', '$quantity')");
?>
I have placed this code in my search program and it will add the term fine. I can also get it to add the value 1 for the first time it is searched from the first line of the code above. But it always just stays 1 no matter how many times it is searched for. . .
Please help.
Thanks!