So I'm trying to make a hit counter unique to each username.
I'm trying to make it so that if the username isn't in the database, it inserts the username into a field called username and inserts 1 as the amount of clicks into a thing called click.
If the username already exists, I want it to add one to the existing click value. I'm trying to make it case insensitive. However, it doesn't seem to work!
$query = mysql_query("SELECT * FROM clicks WHERE username='$ytusernamecheck'");
$numrows = mysql_num_rows($query);
if ($numrows < 0)
{
mysql_query("INSERT INTO clicks (username, clicks)
VALUES ('$ytusernamecheck', 1)");
echo $numrows;
}
else{}