PHP Insert to Db

We will now use our users table inside the database examples:

users table

 

 

 

 

Our users table has 3 columns: id, name, surname.

To INSERT some new data in our table we will:

  1. connect to the server (localhost)
  2. select a database (examples)
  3. create a SQL query
  4. run the query and store the result
  5. check if the query has been successful

You can INSERT more than one row using the following syntax: