Inserting data in PDO can be done in several ways. For fast insertion of static data, we use the
exec() method, which returns the number of inserted rows.
In the example above, we inserted five new people into the users table. Since we separate each INSERT command with a semicolon, we can update the database with multiple records at once with a single method call.
exec() method is suitable for commands where we do not need returned data.try...catch block.