Mysql saves data that web developers use every day. Let's take a look at the tutorial on using the insert statement.
When data is put into a MySQL table, it is called inserting data. When inserting data, it is important to remember the exact name and type of the table column. If you try to create a 500-character essay to become a column and only accept the integer size 3, you will end a nasty error!
Insert data to your table
Now that you have created your table, let's put some data to the puppy! This is the data inserted in PHP/MySQL code as an "example". We learned how to create a table in the past.
<? Php
// Make a MySQL Connection
Mysql_connect ("localhost", "admin", "1 admin") or die (mysql_error ());
Mysql_select_db ("test") or die (mysql_error ());
// Insert a row of information into the table "example"
Mysql_query ("insert into example
(Name, age) VALUES ('tiancmellowman ', '23 ')")
Or die (mysql_error ());
Mysql_query ("insert into example
(Name, age) VALUES ('sandy Smith ', '21 ')")
Or die (mysql_error ());
Mysql_query ("insert into example
(Name, age) VALUES ('bobby Wallace ', '15 ')")
Or die (mysql_error ());
Echo "Data Inserted! ";
?>
Displayed
Data inserted