Questions tagged [fgetcsv]

fgetcsv() is a PHP function which parses the line it reads for fields in CSV format and returns an array containing the fields read.

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:
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…
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…
telexper
  • 2,381
  • 8
  • 37
  • 66
0
votes
2 answers

fgetcsv no longer working

I have been using this code on a webpage for about 2 years and all of the sudden it started giving me an error. Is there any noticeable reason why?These are lines 116 through 120 that are referenced in the error $file =…
shinjuo
  • 20,498
  • 23
  • 73
  • 104
0
votes
1 answer

take a tab delimited file and update a MySQL field based on matching rows to a unique field

Trying to piece together fgetcsv questions and answers to get where I need to be but do not grasp the basics enough to get the result I need. The Tab delimited file sample.... ╔══════════════╦════════════╦═══════╦══════════╗ ║ sku ║ asin…
0
votes
1 answer

fgetcsv formatting individual cells

I have a csv file with this data in it date,title,description 01/05/2013,Test,This is a test 03/05/2013,Test2,This is another test I would like to format it like a news article so the html would be something like

$title

Neil Frost
  • 27
  • 1
0
votes
1 answer

php function fgetcsv not work for line have \""

I have data in phpmyadmin, example: (first row is header) ||from||to||messages|| ||john||andy||meeting now|| ||dony||sherly||Place in \"Jakarta\" , Indonesia, 15412 when I export to csv via phpmyadmin version 3.5.6, I get this csv…
0
votes
2 answers

Read times from a file and find the nearest in the future

I'm new to PHP and have I problem right now. I want to make a file with bus times for a day, and want to show a user the nearest bus in the future. Every day there are just 15 buses, so it wouldnt be a big file. I thought about saving the file like…
rStorms
  • 1,036
  • 2
  • 11
  • 23