How to insert the record in PHP and MYSQL database?

How to insert the record in PHP and MYSQL database?

In this tutorial, we will try to learn the insertion of records in the database table in PHP and MySQL.

Code of insertion of records in the database table in PHP and MySQL

Line 6: Form method as post enables the form to send the values from form to the database.

Line 13:  Ensuring that form is able to successfully post the values to the database or not?

Line 14: Value that is entered in the textbox named as  “TextBoxForTitle” is handed over to the variable  “$TitleVariable”.

Line 15: mysql_query() function is responsible for success execute the MySQL query. According to the mentioned query data can be inserted into the attribute of table “books”. The attribute is “BookTitleAttribute”. The value that is entered by the user, stored in the attribute “BookTitleAttribute”.

Database

Database insert delete view update in php mysql
Figure: Database insert delete, view update in PHP, My SQL.