Things You'll Need:
- PHP Editor (Dreamweaver)
- MySQL
- Apache
-
Step 1
Importing data from CSV files
Since we have lines of values separated by commas, the easiest way to process them is to parse each line using the PHP explode() function: -
Step 2
Dealing with special characters
This simple solution will not work if you have a comma in a value, like for instance when the column is an address and it has a value is like "North street, 1″.
In such cases, the column value in the CSV file is quoted to indicate that the data between quotes should be read as a single column. To deal with this situation, you can use a specially tailored regular expression or use the PHP fgetcsv() function. -
Step 3
Importing CSV data directly into the database
If you are importing data from a CSV file into a MySQL database, you import it directly into a database table. It will be much faster than processing it line by line using PHP. Fortunately, most relational database have tools for the bulk data import from CSV files. Load data command will help you here. For instance, in MySQL you can use LOAD DATA INFILE query statement.
For functions or htmls please visit hurricanesoftwares.com












