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-599c792ca7a81154885461/] 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-599c792ca7a8b767403139/] Step 3: import.php Import the data [crayon-599c792ca7a90076706805/]  ...
Read More