PHP MySQL Insert Data

Insert data in mysql using php

We already know how to establish connection between PHP web application and MySQL database system in our previous PHP tutorial. we also learnt to  select data from mysql database.

Now, In this PHP tutorial we will learn how to insert data into MySQL database using PHP script.

INSERT Statement

The INSERT statement is used to insert record into a table in database.

INSERT Statement Syntax

INSERT INTO table_name
(Col1, Col2……ColN) VALUES (Val1, Val2……ValN);

Col1, Col2 – Indicate the Columns name of table.
Val1, Val2 – is the value of columns respectively.

learn more about mysql INSERT statement : INSERT Statement


PHP Example of Insert data into database

 

Leave a Reply

Your email address will not be published. Required fields are marked *

4 + 2 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">