I used to have the code: the CSV is specified in another php file I can upload it if needed
Code: Select all
$data = fgetcsv ($fp, 2000, ",")
$sql='INSERT INTO test (`name`)
VALUES (\''.mysql_real_escape_string($data[]).'\')';
echo $sql."<br>";
exit();
but i needed to make some changes and are using a multi dimensional array now:
Code: Select all
$rowcount = 0;
$data[$rowcount][] = fgetcsv ($fp, 2000, ",")
$sql='INSERT INTO test (`name`)
VALUES (\''.mysql_real_escape_string($data[$rowcount][0]).'\')';
echo $sql."<br>";
exit();
Can someone see what I'm doing wrong ?