Title: Post Counter plugin database question
Last modified: August 18, 2016

---

# Post Counter plugin database question

 *  [macwise](https://wordpress.org/support/users/macwise/)
 * (@macwise)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/post-counter-plugin-database-question/)
 * I am trying to install the visitor counter plugin, and need help getting the 
   correct information in my mysql database. The plugin is here:
    [http://weblogtoolscollection.com/b2-img/top10.zip](http://weblogtoolscollection.com/b2-img/top10.zip)
 * I am trying to insert this snippet into a table, (however, I am not familiar 
   with mysql very much at all):
    use <your_wpdatabase>; create table mostAccessed(
   postnumber int not null, cntaccess int not null, primary key(postnumber), unique
   id(postnumber) );
 * As I mentioned, this poses a problem because I don’t really know much about mysql…
   like, nothing. How can I create a new table in mysql in command line and insert
   this information? Any help is appreciated.
 * Thanks

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/post-counter-plugin-database-question/#post-223205)
 * Login to phpmyadmin
    Click the name of your database. Follow the first THREE 
   images here: [http://www.tamba2.org.uk/wordpress/backup/](http://www.tamba2.org.uk/wordpress/backup/)
   In that 3 screenshot, you can see an SQL tab In your phpmyadmin, click that tab.
 * On the next screen is a white box.
    Into that, paste this
 * create table mostAccessed
    ( postnumber int not null, cntaccess int not null,
   primary key(postnumber), unique id(postnumber) );
 * Then click Go.
    It will probably ask if you are sure, just say yes.
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/post-counter-plugin-database-question/#post-223206)
 * [http://www.tamba2.org.uk/wordpress/lastvisit/index.txt](http://www.tamba2.org.uk/wordpress/lastvisit/index.txt)
 * That file shows where I put the rest of the code to get it to work.
 *  Thread Starter [macwise](https://wordpress.org/support/users/macwise/)
 * (@macwise)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/post-counter-plugin-database-question/#post-223217)
 * Thanks for the swift reply, podz. I guess I am deeper in this than I thought.
   I currently don’t have phpmyadmin configured to see the tables for the wp database
   tables. I am not sure if I should get that setup, or if I should rather just 
   do this from command line. If it isn’t too much trouble, I would love to get 
   the phpmyadmin up and running, but I am going to need a few pointers before I
   get it going, let alone the script. Thanks
 *  Thread Starter [macwise](https://wordpress.org/support/users/macwise/)
 * (@macwise)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/post-counter-plugin-database-question/#post-223218)
 * btw, phpadmin comes back with this:
 * Server localhost
 * Error
 * SQL-query :
 * SET PASSWORD = PASSWORD( ‘**********’ )
 * MySQL said:
 * #1044 – Access denied for user: ‘@localhost’ to database ‘mysql’
 * It appears that permissions are not correct
    Any ideas on what permissions I 
   need to change for phpmyadmin to function, while still keeping me safe?
 *  Thread Starter [macwise](https://wordpress.org/support/users/macwise/)
 * (@macwise)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/post-counter-plugin-database-question/#post-223229)
 * Ok, I got the phpmyadmin figured out. I actually got the plugin working as well.
   However, it is activiated through the main index.php file, and therefore counts
   any visit to that page on any post that is there at the moment. I would like 
   the script to count the index page once EACH TIME someone visits it, but I would
   also like the counter to ONLY count posts when they are visited at the posts 
   URL. Is that completely unnecessary, or wrong, or is this a common thing to want
   a counter to do? Please let me know what I should expect out of this and any 
   reasons why this may not be the best approach. Thanks.
 *  Thread Starter [macwise](https://wordpress.org/support/users/macwise/)
 * (@macwise)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/post-counter-plugin-database-question/#post-223232)
 * Also, podz:
 *  [http://www.tamba2.org.uk/wordpress/lastvisit/index.txt](http://www.tamba2.org.uk/wordpress/lastvisit/index.txt)
 *  That file shows where I put the rest of the code to get it to work.
 * I didn’t quite understand this last post by you. I went there, and only found
   a graph and a few other lines of code. Should I be looking for something specific?
 * Thanks
 *  Thread Starter [macwise](https://wordpress.org/support/users/macwise/)
 * (@macwise)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/post-counter-plugin-database-question/#post-223235)
 * OK, let me start over. When I go to the index page of my WP site, the posts show
   up, and the visitor counts show up in the header bar for each post.
 * The problem is that the numbers all correspond to eachother. The top post has
   the same number of views as the second post, and the third, and so on.
 * When I visit a post by clicking on it’s respective link, it takes me to that 
   page, and it shows that there is another visit, but when I go back to the index
   page and refresh, it shows the number that the individual post had, only the 
   other posts all have that new number as well.
 * For instance:
    If I have 15 views showing on each post in the index page, and
   then click on the top post, it shows me the new post with the number of views
   elevated to 16. If I refresh that page, the number stays at 16. If I go back 
   to the index page, however, and refresh it, then all of the posts now say 16 
   views. If I refresh again, then they all say 17 views, and so on.
 * I am not sure what I am doing wrong, but I would obviously like each post to 
   record independently how many views it has had. I am not sure it is such a bad
   thing to have the post views counted from the index page, but I KNOW that I do
   want the posts to be counted from that post being clicked on and viewed seperately.
   Please help.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Post Counter plugin database question’ is closed to new replies.

 * 7 replies
 * 2 participants
 * Last reply from: [macwise](https://wordpress.org/support/users/macwise/)
 * Last activity: [20 years, 11 months ago](https://wordpress.org/support/topic/post-counter-plugin-database-question/#post-223235)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
