Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I insert Excel data into MySQL PHP as an array?


What I have tried:

PHP
$file = "your-file.xls";
 $handle = fopen($file, "r");
 $c = 0;
 while(($filesop = fgetcsv($handle, 1000, ",")) !== false)
 {
 $name[$c] = $filesop[0];
 $email[$c] = $filesop[1];
 $c += 1;
 }
Posted
Updated 27-Nov-19 11:14am
v2
Comments
Richard MacCutchan 27-Nov-19 13:46pm    
MySQL does not have an array type. You could just save it as a VARCHAR type. But the question is not clear.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900