09- MySQL Insert Query

0
237

The MySQL Insert Query is used To insert a record in MySQL database the statement used is INSERT INTO command.

Syntax:

INSERT INTO name_of_table (column1, column2, column3,…)
VALUES (value1, value2, value3,…)

 

Rules in performing the INSERT INTO Command:

  • A Numeric Values and NULL word should not be quoted
  • String Values inside SQL query should be quoted
  • Using PHP all SQL query should be quoted
  • No Need to specify a column that is SET to AUTO_INCREMENT and TIMESTAMP

 

In the last tutorial called 08-MySQL Create Table, we created a blank table named ‘tblpeople’. This time, we’re going to populate this table.

 

Here are the different examples on how to populate the ‘tblpeople’:

 

Example using MySQLi (Object-Orient):

 

Example using MySQLi (Procedural):

 

Example using PDO:

 

The Previous Topic called: 08- MySQL Create Table

Facebook Comments
  • books
    books
  • mysql-php
    mysql-php

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.