How to Create an Advanced Comment System Using PHP and MySQL

How to Create an Advanced Comment System Using PHP and MySQL
The comment system we'll be creating will have an anti-spam system (Google's recaptcha) and use a MySQL database to store the comments. 

This tutorial is longer than usual because it is better ;)

I apologize for the incredibly shitty sound, I have been battling with my microphone all day...

Here are some links I've used in the video:



It's important to structure your code in a manner that makes error detection as easy as possible. This is why I use so many if statements when working with MySQL - fixing mistakes becomes a breeze.

If you have any questions, post a comment below, or send me an email, and I'll try get back to you ASAP. 

Oh and, one more thing... subscribe!

RRelated Posts

Solar Fields - Random Friday (Album Plein)

Cet album en HQfrançaise http://youtu.be/iw12zvPubyc 01 - Light Control 00:00 02 - Random Friday 4:56 03 - Cobalt 2.5 11:12 04 - In Motion 18:45 05 - Daydreaming 27:01 06 - Swoosh

Python vs PHP Comparison

Patreon | https://www.patreon.com/jream Premium Full Courses @ http://jream.com This is a basic comparison of the languages and why I really like Python. I still like PHP, but I really like python.


  • Chess marka
    why did you show your private key at 9:11?
  • happynightmare
    doesnt wrk when i use chrome or any browser for that matter and jusy shows me the code and nothing else
  • music boy
  • AB Binion
    The link is no longer available
  • devboy
    please provide source code
  • Jennifer Rosenow
    Thank you so much! That was extremely helpful. Is there a way to make the comments display below the HTML form instead of above it? This was posted a while ago, so I hope you get this message. Thank you again!
  • Yarin Azulay
    i dont understand can u help me on skype ?
  • Daski69
    I've made login form that works, it will be integrated into a website that I created previously.

    I want to create a comment form that only works if one is logged in. How would I do that?
  • Nyan Cat
    You accidentally revealed the private key at 9:13 :/
  • Fumio Noguchi
    thanks for the tutorial
  • ClassicCartoons
    How do you make a comment form without writting your name ? A comment form just like youtube uses . How do you do this type of comment form?
  • Abeeku Djokoto
    yeah how can use a comment system for my different webpages ?? do you have to create a new database every time you create a comment system am really confused here please help
  • Call me Cloud
    ty for the private key mate.
  • Computer Science
    Great dear. good job!
  • Etikyala Naresh
  • Zakaria Esbaiy
  • Kenneth Mokgoshi
    great tutorial can you please a create a tutorial that reply's to a comment
  • MaxPicAxe
    I saw your private key twice.... Edit it better...
  • Sarfraz Khan
    excellent tutorial . god bless you
  • Jonathan Ekholm
    Meh! :/ This is just like every other comment script out there. I really want a script where you have to register to comment. I know where to get one but it costs 14 USD.
  • Tim Thacker
    if you are viewing this video after this comment, find a newer tutorial that uses PDO instead of the old mysql_connect that is used in this video
  • Kaden Burgart
    26:44 - private key is exposed
  • franco santiago
    sir can you explain to me the database of that comment system..
  • צופים אולגה
    how i got the recaptchalib.php ?
  • Alexander Markov
  • Aggraphics
    how to display comment with user image?
  • Josue Hernandez
    excellent tutorial, I followed each step carefully and it worked fine, if you need the recaptchalib.php you'll find it on google and click on the first page, I missed one thing though, how would you add the time and date when the comment was posted? Thanks
  • rana el-shenaity
    whats written in recaptchalib.php or where should i find this file ?
  • Aruna Tebel
    Awesome tutorial... !
  • Karthi Naga
    Nice tutorial mate. . .
  • Spoty
    Hey faglord links are broken fix them, if you cant pay a domain add the script on a file hosting
  • SeiNj
    would a NoSQL database be more effective for large comment database ?
  • Jon Steven
    I get a" mysql_fetch_array() expects perameter 1 to be a resource" error, any help?
  • Aderinto Abdulquadir
    what if i am to use it for different articles on the same website.
  • Nathan Wooten
    I can't find the files anywhere. Can anyone help??
  • Mihai Cristian
    NOTICE: This domain name expired and is pending renewal or deletion. nice ..
  • Al Pacino
    I need the file. Where do I find it? :)
  • Al Pacino
    The files aren't on your website.
  • spruzstuff
    Did I miss the part that stripped tags and blocked from injection and ect....?
  • jerome anyayahan
    great tutorial i understand well..
  • Hairlikecottoncandyy
    Nice vid, I'm enjoying the series. Let me give you some suggestions as a viewer. 1) This video is not part of any playlist, and so are some of your other uploads. You'll get more views if you organize ALL your tutorials into playlists by category, this logically falls into the MySQL playlist. 2) You may want to have a separate account just dedicated to this tutorial stuff, and a separate private account. Then your playlists are all tutorials. That's up to you I guess.
  • Hairlikecottoncandyy
    This one builds nicely on all previous tutorials. Also, the tutorial doesn't say it is for beginners, so you can't really expect that.
  • Ben Sterling
    Not Found :(
  • zelenco mihnea
    9:13 YOUR SECRET KEY IS QUITE VISIBLE... Dude with all the respect... your tut is not quite advanced... You could include some pagination for your coments. You don't need so much mysql_connect usage and so on...
  • Wrokzor
    these tutorials are awsome mate, so glad i subscribed :)
  • flash4real
    All these things have been explained in my other PHP tutorials.
  • Aaron Welsh
    Glad to help !
  • Aaron Welsh
    Gmail won't allow me to send a message to you. It says it's an invalid address. I'll YouTube message you the link to download. I uploaded it to 2shared :)!
  • Aaron Welsh
    Never mind I found the file. Guys, message me if you want all the files. I'd leave a link here but I don't want to look like I'm spamming the dudes channel.