Hey All,
I'm making a MySQL/PHP hit counter, to "sniff" the browser and calculate how many times each browser is hitting my site.
Here's what I have:
I've got the hits updating, but the browser isn't being added, I just get a blank entry.Code:$bowser_sniff == $_SERVER['HTTP_USER_AGENT']; $db = mysql_connect("localhost", "user", "passwd"); mysql_select_db("hits_db",$db); mysql_query("UPDATE hits SET counter=counter+1 WHERE browser = '$bowser_sniff'",$db); if (mysql_affected_rows($db) < 1) { $result = mysql_query("INSERT INTO hits VALUES ('$bowser_sniff', 1)", $db); }
And help would be appreciated.
Edit: I'm almost certain it's something to do with the variable in themysql_query
Thanks
X96



Reply With Quote

I know... I did that on purpose...
Bookmarks