$query="INSERT INTO `main_table` (`count`) VALUES ('$count') WHERE userid='$someid'";
basically I like to insert a new value of count into the variable count in the main_table where the userid equal to a variable someid.
SQL complains the syntax on this statement.
To update an existing row you should use an UPDATE statement instead of an INSERT statement.
See it working online: sqlfiddle
INSERT is only used for inserting completely new rows into your table. It is not legal to have a WHERE clause on an INSERT statement.