PHP Message Board Pt 1

MySQL LogoI show you how to create a PHP / MySQL message board in this video tutorial. I start by showing you how to properly set up the database. this can be looked at as a review on how to write SQL as well.

I specifically will review how to:

  • Create Databases
  • Create Tables and the Data Contained in them
  • Use the Insert Command
  • Use the Alter Command

We’ll also review a bunch of other things in regards to SQL. If you want to see more on SQL check out this article / video MySQL Statements Tutorial.

Leave any questions or comments below. If you’d like to recommend a future tutorial, leave that below as well 🙂

14 Responses to “PHP Message Board Pt 1”


    Thank you for excellent tutorials. I did enjoy this very much and it helped me link all the steps together. Can you send me the link to the script files, I did not find them on the page.

    On another matter, I am trying to put together a PHP MySQL store front together that allows multiple people to list and ADMIN there own entries. If you have any tutorial please let me know.

    Again, thank you and I consider your teaching methods to me the best I have ever seen or used on the Internet.

    If you don’t mind me asking where and how did you learn your skills. My daughter is planning to study software engineering and I would value your input.

    Thank You and Best Regards,
    Dennis Fuller

    • admin says:

      You’re very welcome. I’m glad you liked them. Here is a link to a page that contains a link to the zipped archive PHP Forum.

      I’m going to create a few shopping carts over the next month. They should answer your questions.

      I’ve been programming all of my life. I learned BASIC on a TRS-80 when I was very little. I then learned assembly language. I was the kid walking around in high school with giant 5 inch thick books 🙂

      I’m 100% self taught. I’ve only ever taken one computer class on Fortran. It was a requirement for my education in electrical engineering.

      All of the great programmers I have known spent most of their waking moments dreaming about what they were going to make next. Game programmers seem to be literally addicted. I was probably addicted in my late teens / early twenties?

      My only advice is to learn all of the ins and outs of each language before moving on. Also learn how to get the job done as quickly as possible. That is going to require your daughter to build a library of premade functions that she’ll use over and over. The creation of that library is the most valuable tool she’ll make during her time at university.

      I hope that helps?


    yo man you d bomb… i no see nobody like u man. U original brain box. haya do that man. u make go bananas wen ya code,talk at the same are u human cuz man ya dont breath. All ma school teachers are BOMBOCLARCK. RUDA say peace.

  3. Whats up are using WordPress for your site platform?
    I’m new to the blog world but I’m trying to get
    started and create my own. Do you require any coding
    expertise to make your own blog? Any help would be greatly appreciated!

  4. Matt says:

    Hi Derek,
    I really love the videos I am learning a lot. Just a few questions: 1) Do you have a tutorial that shows how to create profile pages. For instance something like facebook, where anyone can make profile pages and then interact with others by connecting or posting messages on their profile page. 2) HTML seems easier to mark up a web page than PHP, can you just code everything in HTML and CSS then use PHP/MySQL to create profile pages. I apologize if these are not very good questions. I am just learning.
    Thank you for all you do.

    • Derek Banas says:

      Sorry, but I never made a robust social network type site. If I was going to try I would lean very heavily on the Zend framework for security reasons. I however doubt that anyone could truly create a robust social network on their own and then constantly update it to close security holes. Any time you allow people to upload anything to your server that creates a security risk. it is very easy to upload a script through a system that only tries to allow image uploads for example. You could change names and link to all uploads using false names to avoid these problems, but there always seems to be a new way in.

      I’ll cover Zend as soon as possible to cover much of what I mentioned above.

      • Matt says:

        Hi Derek,
        Thank you for your response. I think it is amazing how you take the time to answer everyone. I know it must mean a lot to everyone.
        I think I might have worded my first comment wrong. I do not want to create a facebook website. What I am looking to do is create a website where after you login it directs you to a profile page. It does not have to be an extensive database of people. Just a simple profile page where you can write your name, likes and things like that. Then I am going to have forumns on multiple pages that the users can comment on. I have the page layouts done (which I used your other tutorials for) I just need to now create the profile page, the forumns on multiple pages, and the ability to comment on them.
        I really appreciate all you do.

        • Derek Banas says:

          Hi Matt,

          I do my best to answer all questions. It is hard some times to keep up with them now since I get hundreds a day, but I do my best.

          It is actually pretty easy to do what you want. You have to have a pretty solid understanding of html, css, javascript and php (Maybe JQuery if you want everything to be dynamic)

          I provide tutorials on all of these topics here on my site. In the menu look in Videos – Web Programming to find those tutorials. I hope they help 🙂

  5. Luke says:

    Installed in on my localserver, but got

    ( ! ) Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

    ( ! ) Fatal error: Unknown: Failed opening required ‘C:/wamp/www/msgbrd/index.php’ (include_path=’.;C:\php\pear’) in Unknown on line 0
    when I tried to open it up, what does that mean?

    Also Heres the SQL to create the three databases and to insert dummy data, im having a little trouble inserting new members (a few new rows were added and dont know how to change the insert statement?

    CREATE TABLE users(
    username VARCHAR(30) NOT NULL,
    passwd VARCHAR(30) NOT NULL,
    email VARCHAR(40) NOT NULL,
    token_id INT(11),
    first_name VARCHAR(20),
    last_name VARCHAR(20),
    active CHAR(32),
    PRIMARY KEY (user_id),
    UNIQUE KEY (email)

    CREATE TABLE messages(
    parent_id INT UNSIGNED NOT NULL,
    subject VARCHAR(50) NOT NULL,
    message_txt LONGTEXT NOT NULL,
    parent_id INT UNSIGNED NOT NULL,
    PRIMARY KEY (mess_id)

    CREATE TABLE topics(

    topic VARCHAR(25),
    PRIMARY KEY (topic_id)

    INSERT INTO topics (topic) VALUES (‘News’),(‘Strange’),(‘Celebrity’),(‘Politics’),(‘Sports’);

    INSERT INTO users (username,passwd,email) VALUES (‘Administrator’,’test’,’’),(‘Dale’,’test’,’’);

    INSERT INTO messages (user_id,topic_id,parent_id,subject,message_txt) VALUES (1,4,0,’What is the best team?’,’In your opinion’),(2,4,0,”What is the best team?’,’Chargers’);

Leave a Reply

Your email address will not be published.