This mysqli_query command results in the error below
mysqli_query("INSERT INTO `counter`.`hits` (`page_hits`) VALUES (1)");
From the manual
Procedural style
mixed mysqli_query ( mysqli $link , string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
You'll notice the $link and $query variables.
This means that you need to pass the function a valid mysqli link resource as well as the query you wish to perform. This lets the function know which established connection to the server to use.
A link resource can be created using:
Procedural style only: A link identifier returned by mysqli_connect() or mysqli_init()
and an example of how to do so can be found on the aforementioned manual page.