To increase the default WordPress memory add the following line to the wp-config.php file:
define(’WP_MEMORY_LIMIT’, ’64M’);
You could write a very long PHP script that will allow you to upload a CSV file to a Mysql database but this could take more time and memory. So you could import the CSV file directly into the Mysql database/table. phpmyadmin will allow you to do this very easily, if you browser through the tool. Below I shall show you a MySQL SQL that will do it easily.
To import a CSV/Excel file into a MySQL database/table. If it’s an Excel file you would need to export it to a CSV file and remove the CSV headers, comments/empty data from the generated CSV that Excel might include.
Then use the following SQL prototype into the MySQL table.
LOAD DATA LOCAL INFILE ‘C:\\xampp\\tmp\\example.csv’ REPLACE INTO TABLE ‘tablename’
FIELDS TERMINATED BY ‘;’
ENCLOSED BY ‘”‘
ESCAPED BY ‘\\’
LINES TERMINATED BY ‘\r\n’
The REPLACE keyword is optional. As well as the ENCLOSED BY, ESCAPED BY and lines LINES TERMINATED BY, these control how data is extracted from the CSV file for instance they can help if you have columns enclosed with double-quotes such as Excel exports, etc.You can also include the table feilds at the end for example:
(firstfield, secondfield, thirdfield)
These are the fields where the data will be put in that order.