- In this tutorial, I will teach you how to create a very simple blog script using PHP and MySQL. This tutorial will teach you how to insert records into a MySQL database using PHP, create tables in a MySQL database using PHP, update records in a MySQL database using PHP, and display database entries on your web page using PHP.

This is a very simple blog script that will teach you the basics that most other PHP scripts utilize in some form or another. It will also teach you how to create forms and collect data using PHP and MySQL.

Tutorial files can be downloaded from:

Visit our home page at:

17 Responses to How to Create a VERY Simple Blog Script with PHP & MySQL

  • greysonthecat says:

    This did not work for me.  I tried everything.  I even downloaded then used his code and changed it to my specifications.  Still did not work.

  • Joe Zambory says:

    This really helped understand how mysql worked with php. I was able to complete the tutorial and got it to work. There was an issue withe dinsert.php code. the second set of code for update of the entry did not work. I think what you are showing and what the zip file has is slightly different. When I copied that piece over what I was following on the tutorial then it worked. So some mistyping was going on. Thanks good tutorial. Now show how to password the form interface and how to remove entries with it. Thanks again. Nice tutorial

  • Christopher Pezza says:

    helped me really understand how it functions finally!

  • PychoKammer says:

    Great tutorial! I learned more in the last 44 min than I did surfing the web for 3 days!

  • Matthew Kosloski says:

    What about a permalink option?

  • Matthew Kosloski says:

    This is much more simple:

    // connects to database
    mysql_connect("localhost", "root", "password");

  • Jonathan Smith says:

    do you have an newly version of this? and links working? =/

  • Alin Lazar says:

    how can I download the files??? :(

  • Jon Lambert says:

    I'll love to watch your scripts man they're pretty cool I wish I can make one 

  • ‫كاســـكۆ‬‎ says:

    i am using localhost but i cant insert any data to the db its just loading please help ?

  • Aneta Takh says:

    I also struggled with creating tables. After a few hours this worked:
    mysqli_query($con, "CREATE TABLE Entries (Id INT ) ");
    mysqli_query($con, "ALTER TABLE Entries ADD Title VARCHAR(20) NOT NULL");
    Doing Auto_Increment for the ID inside the code also did not help. I set it as Auto_Increment and Primary Key from PhpMyAdmin Ddatabase interface

    as for insert.php, the following worked

    include "mysql.php";
    $user_Title = $_POST['title'];
    $user_Subtitle =$_POST['subtitle'];
    $user_Content = $_POST['content'];

    $sql = "INSERT INTO Entries (Id, Title, Subtitle, Content) VALUES ( NULL,'$user_Title', '$user_Subtitle', '$user_Content')";

    $result5 = mysqli_query($con, $sql)
    or die ("it did not work out");

  • syyed shoeb says:

    nice tutorial

  • Mark Roberts says:

    Is it still possible to download the files? I notice the link is broken?

  • Mark Roberts says:

    Does anyone know how to create a simple one line cms for an event page. Just date, venue, time. the a link for adding a new row and save or delete?

  • Issam el says:

    MYSQL connection is no longer secured, this videos is outdated, the new connection is PDO that is avaible in recent php versions

  • Beth Pizana says:

    Thank you very much I know this is old and as the guy below said probably not the most secure way to do things… But for the school project we are doing this is just the tutorial I needed to get me started.

  • Tristan Schlarman says:

    Or Rather

Latest Comments



You Count


Twitter Stuff