Insert Data Into Table in Database through PHP:

To insert data in database first create a table in the database. Now you can insert data into table by insert query.

Syntax:

$sql = “ insert into table_name (column1, column2,….) values (val1, val2,….)”;

mysql_query($sql);

We created the table “employee_details” in “employee_info” database. In that table we have 5 columns and we now insert data in table through insert query.

Example:

 

Leave a Reply

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