• Wednesday , 22 August 2018

PHP MySQL Tutorial: Create a Simple View Counter -HD-

Code Canyon

In this tutorial, you will learn how to create a simple view counter with PHP and MySQL. Be sure to SUBSCRIBE because there will be a new tutorial every week.

Original source

3d Ocean

Related Posts


  1. Rush25 Solutions
    August 8, 2017 at 11:57

    Thanks man, saved me a lot time. got it done right after you did id='1'. God Bless!

  2. Mahrukh Aslam
    August 8, 2017 at 11:57

    Thank you RCG .. ­čÖé Its really helpful for us ..

  3. Romy Kim
    August 8, 2017 at 11:57

    I have to say "Thank you!!!!" for this video. I have seen many videos online. Your approach cover essential basic concepts without overwhelming learners and it simply works. Expanding it into more complex form belongs to learners. Subscribed.

  4. Juraj Ondrušek
    August 8, 2017 at 11:57

    very very good, thanks. Please add option for ignore my IP address in counter. THX!

  5. M.
    August 8, 2017 at 11:57

    Good job dude!

  6. Pathfinder
    August 8, 2017 at 11:57

    Thanks! Great tutorial!

    August 8, 2017 at 11:57

    it seems that ' ' is the same as ""?
    What about “?
    Can you explain the differences?

  8. Justin Munce
    August 8, 2017 at 11:57

    Can you make it count for one view per IP per day per page? Otherwise you get counts for refreshing.

  9. Dervz
    August 8, 2017 at 11:57

    Mate, i really appreciate your work. After watching a ┬átutorials of other people who explain same staff but taking freaking 50 minutes or so comparing to your 15min (because of extremeley fast speaking – you need to do some freestyle btw). Amazing, thnx again ­čśÇ

  10. bh russian
    August 8, 2017 at 11:57

    i want to know how to make points system works? when user click on each item in the product list he gets certain points on each products. In other words, giving reward to customers if they spend more than £10.00 then they will get 10 points.

  11. Carlos Carlsen
    August 8, 2017 at 11:57


  12. powerade310
    August 8, 2017 at 11:57

    Why did you use a while loop?

  13. Artem N.
    August 8, 2017 at 11:57

    But your MySQL query in php-code does't properly work for me.
    On 5:06 You had written:
    mysql_query ("UPDATE viewcounter set 'views'='views'+1 WHERE id='1'");
    Correctly working variant for me:
    mysql_query ("UPDATE viewcounter SET views = views+1 WHERE id=1");
    PLEASE, explain to me, why is your query with apostrophes working well, but on my machine there was an syntax-error.

  14. myp410up
    August 8, 2017 at 11:57

    Thanks for this tutorial video. I wanted to know why in the UPDATE and SELECT statement the id field value, which is an integer and not a string, was enclosed in quotes.

    Also, after retrieving the record into the $row variable, you could save a few steps by using the extract($row) method, which will create vars based on the keys of the array. How did php know to make $row an associative array instead of a numerically indexed array? I thought that you had to either call mysqli_fetch_array($sql, MYSQL_ASSOC) or call mysqli_fetch_array_assoc($sql). 

    In the code for the index counter, wouldn't it be simpler to use a single php statement such as  <?php echo "<p>There are $views views on the $pagename page.</p>" ?> ? Thank you.

  15. myp410up
    August 8, 2017 at 11:57

    Thanks for another informative and easy to follow tutorial on PHP. It really brings home the concepts discussed in my textbook. Can you elaborate on the variable that was assigned to the query result? As a VB programmer, it seems to me that the variable is the equivalent of an ADO recordset object. Am I on the right track as far as grasping the basic idea? Many thanks for all your great work!

  16. birdas salvatore
    August 8, 2017 at 11:57

    if i want this counter to my html page how can i do. because this counter is php file …

  17. Jeehoo Ahn
    August 8, 2017 at 11:57

    when i select "defined as" and "0" for my views column, it says it's invalid and won't let me save or proceed

  18. Pav Ayush Fatima
    August 8, 2017 at 11:57

    thank you.. is this relevant to Object Oriented PHP 5 as well.. As these are basic features anyway.

  19. Andy Pai
    August 8, 2017 at 11:57


  20. Jennifer Verdin
    August 8, 2017 at 11:57

    Thank you! You made learning how to extract data from a database so much easier to follow!! Keep doing these tutorials, you have taught me so much ! Thank you ­čÖé

  21. uradamnfool2
    August 8, 2017 at 11:57

    THANK YOU! This tutorial was GREAT and EASY TO FOLLOW!

  22. borofalcon101
    August 8, 2017 at 11:57


  23. kevin coyle
    August 8, 2017 at 11:57


  24. Mohd Obid
    August 8, 2017 at 11:57

    How can i thank you

  25. jazzflutist
    August 8, 2017 at 11:57

    I have to thank you for taking the time to teach all of this to us. Much appreciated. Great presentation.

  26. Antonio Alaniz
    August 8, 2017 at 11:57

    This was very helpful! Thanks again!

Leave A Comment

You must be logged in to post a comment.