PHP and MySQL hit counter multiple pages count problem? -
The following script will update the database, but it will not display the correct page number on each separate page. This will freeze the number of pages on the page for a reason.
Here is the PHP code:
If you give a table structure, then it would be better because the way I Understand that the table structure is that you are using the page string as the id
, it is clear from your inserted query select the ID as the page ... where the page = ...
I do not know your table structure. So I can not say that the problem is with inserting or updating.
If the above notion is correct then replace the updated statement in the section where you placed the page
in the updated query instead of the id
$ dbc = mysqli_query ($ mysqli, "UPDATE mysql_counter_logs SET hits = hit + 1 WHERE id = '$ page'");
Comments
Post a Comment