To insert data into MySQL table you would need to use SQL INSERT INTO
command. You can insert data into MySQL table by using mysql> prompt or by using
any script like PHP.
A D V E R T I S E M E N T
Syntax:
Here is generic SQL syntax of INSERT INTO command to insert data into MySQL
table:
NOTE: Please note that all the arrow signs (->) are not part of SQL
command they are indicating a new line and they are created automatically by
MySQL prompt while pressing enter key without giving a semi colon at the end of
each line of the command.
In the above example we have not provided tutorial_id because at the time of
table create we had given AUTO_INCREMENT option for this field. So MySQL takes
care of inserting these IDs automatically. Here NOW() is a MySQL function
which returns current date and time.
Inserting Data Using PHP Script:
You can use same SQL INSERT INTO command into PHP function mysql_query()
to insert data into a MySQL table.
Example:
This example will take three parameters from user and will insert them into
MySQL table:
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords:
MySQL Insert Query, Mysql Tutorial, Mysql tutorial pdf, history of mysql, basic mysql, syntax use in mysql, mysql software download, learn mysql, mysql insert, mysql delete, mysql data types, mysql administrator.