Import CSV data to MySQL table

Here is a simple code to import CSV data into a MySQL table. There is no need to use MySQL frontend. Below is web based form to select a CSV file and import the records in a MySQL table Step 1: add.php First of all create a form to select the file Note that the values of the select box should match the table names in the MySQL database e.g. table_name_A, table_name_B, etc [crayon-59c674238de68886068654/] Step 2: config.php Create a config file Always a good idea to create a config file to declare your database connection and file import settings. [crayon-59c674238de71432594332/] Step 3: import.php Import the data [crayon-59c674238de76418497581/]  ...
Read More