Re: fgetcsv() only returns half of the rows

From: Date: Fri, 26 Sep 2003 17:32:49 +0000
Subject: Re: fgetcsv() only returns half of the rows
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-30714@lists.php.net to get a copy of this message
On Saturday 27 September 2003 01:24, Karen Resplendo wrote: > Does that mean that my length setting has to be exactly the length of the > row? No. > I don't know this because it is a comma delimited file, not a space > delimited. The function description says: > > "The length parameter must be greater than the longest line to be found in > the CSV file (allowing for trailing line-end characters). " So set it to [max line length]+10. > I removed this block where I do an fgets() and then I get all rows > displayed. Also, I was mistaken about total rows. There are 123 and I only > display 62, which is half, so I'm thinking something is being incremented > twice instead of once. Exactly, that block of code below is reading in another line. What is it's purpose anyway? What are you trying to achieve? > What should I set the length at?: > > $buffer = fgets($handle,300); > $buffer = str_replace("\"","",$buffer); > print $buffer."<br>"; -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db ------------------------------------------ /* The wise man seeks everything in himself; the ignorant man tries to get everything from somebody else. */

« previous php.db (#30714) next »