fgetcsv() is a PHP function which parses the line it reads for fields in CSV format and returns an array containing the fields read.
Questions tagged [fgetcsv]
491 questions
0
votes
2 answers
Sending php mail to csv list
Im trying to write a simple script to send a message to .csv list of e-mail addresses like this:
mail1@mail.com,
mail2@mail.com,
mail3@mail.com,
Here is what I have tried:
$csv = array();
$file = fopen('test.csv', 'r');
while (($result =…

Tomas Jacobsen
- 2,368
- 6
- 37
- 81
0
votes
0 answers
Nested For-Loops in PHP with fgetcsv
I'm pretty sure you are going to take one look at this and laugh, but I dont fully understand how fgetcsv works, I just know it retrieves the contents of the csv file I am pointing at. I dont understand the auto-increment of it. So in the first few…

geoff
- 9
- 2
0
votes
1 answer
combine rows from fgetcsv arrays
Basically I have a csv file with order information on it, ordered from a website, containing invoice number, name, address, etc. I've used PHP to turn this into invoices. It looks pretty good but I'm completely stuck on one bit.
Here's the opening…

Elliot Reed
- 739
- 3
- 11
- 28
0
votes
0 answers
MySQL load data in-file and fgetcsv
I try a bit with CSV import methods. In the moment I use fgetcsv with each row validation and inserts, which works but is slow. So i thought to use load data infile instead.
The CSV is exported by excel with ; as standard delimiter. Its from…

Clemens Hadenfeldt
- 33
- 1
- 5
0
votes
2 answers
Display last entered data from CSV file in PHP?
I have a CSV file with an initial header row and an unknown number of rows. The row format is:
name_data, email_data, cell_data, dob_data
I'd like to open the CSV file and then depict the data from the last entered row in a table, like this:
Name:…

Joe Lowery
- 562
- 11
- 26
0
votes
2 answers
Unable to submit csv file data into corresponding database fields using PHP
Currently I am trying to upload a CSV file and enter each record into the database 1 by 1. The columns on the CSV have the same name as the field names in the database but sometimes the data will be in a different order within the CSV. When I say in…

AyeTry
- 75
- 3
- 12
0
votes
1 answer
PHP fgetcsv array issues with comma delimiting
I seem to be having a problem with my fgetcsv command not comma delimiting, basically what is happening is my data is just one really long string in an array. I need the data to be in an array format for the implode function to work properly for…

Mikael
- 43
- 6
0
votes
0 answers
php fgetcsv and Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data
i have the following code, just for debug purpose:

sd1sd1
- 1,028
- 3
- 15
- 28
0
votes
1 answer
While Loop using fgetcsv only updating MySQL Database on first instance
I'm pulling a CSV file into a script, parsing it and then updating my MySQL table. The problem is that it's only inserting the data from the second row of the CSV file (first row is being skipped because it's the headers of the columns). Here's my…

MillerMedia
- 3,651
- 17
- 71
- 150
0
votes
1 answer
CSV line stops after 22,000 when displaying file content using php fgetcvs
The csv file contains 37,000 lines but it only displays up to 22,000 lines
$csv = fopen('1'.'.csv','r') or die("can't find file");
echo "";
echo…