This is the easy method to upload/import your csv file data in mysql table, using the simple php code. We are using the ( PHP-PDO ) for the communicates with mysql database.
Bellow is the easy and simple steps for using this code. Create a mysql table using the bellow code :

Create datbase table

Html Code

PHP Code using PDO