

If this function returns false then use function addslashes() to add slashes before quotes.
PHP MYSQL INSERT INTO HOW TO
Let’s see the syntax how to insert into table, considering database already exists. The username used to access the database. It can be done with following ways With the help of dummy table In this case, we insert the value from dummy table along with some conditions. This is done by using the mysqliconnect () function, which requires the following parameters: The name of the database server. INSERT INTO statement is used to insert new rows in a database table. The first step in inserting data into a database using PHP is to establish a connection to the database. While doing data insert its best practice to use function get_magic_quotes_gpc() to check if current configuration for magic quote is set or not. Prerequisites : MySQL introduction, Creating MySQL database. In real application, all the values will be taken using HTML form and then those values will be captured using PHP script and finally they will be inserted into MySQL tables. Try out following example to insert record into employee table. Below a simple example to insert a record into employee table.

Data can be entered into MySQL tables by executing SQL INSERT statement through PHP function mysql_query.
