How to insert data into MySql using PHP

3

- Advertisement -

In this tutorial i will explain how to insert data into MySql using PHP.

First Create a database with name demo. Now create a table with name data.
Here the strcuture of table

Code for mysql connection with php

Create a HTML Form for user inputs

Now get user inputs and store in the PHP variables

Query for insert data into mysql using PHP

Full PHP Script for insert data into database using mysql

Here is the full code that we have written during this tutorial:

Download Source Code(How to insert data into MySql using PHP)
Size: 27.8 KB
Version: V 2.0

- Advertisement -

Leave A Reply

Your email address will not be published.

3 Comments
  1. lav soni says

    data not inserted with ‘ in mysql why

    1. Anuj Kumar says

      Are you getting error ?

  2. vivek raj says

    Hey,
    Great, thanks for sharing us. really it’s very useful.

Leave A Reply

Your email address will not be published.