Re: Strip of code - what could be wrong?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wiberg wrote:
> I'm trying to figure out some code I haven't done myself, but I don't get
> what could
> be wrong. Check this code out:
>
> the coder says he when he import files, he gets a result that the line
> ends
> at wrong positions... Is it 4096 that is wrong?

No, the 4096 is not "wrong"

It only reads 4096 characters at a time, but you are putting them into the
$rader array, and then you walk through the array, and then...

You don't show us how to put those pieces back together, so we have NO
IDEA what's wrong.

Post more code -- like the stuff up to and including the insert into DBcode.

WILD GUESSES:
What is the SQL definition of the column you are using to store the line?
Most likely your database is chopping off text that is too long.

> /G
> @varupiraten.se
>
>
> $file = $rad[url_productlist];
> $OpenFile = @fopen($file, "r");
>
> while (!feof ($OpenFile))
> {
>     $buffer = fgets($OpenFile, 4096);
>     $rader[] = $buffer;
> }
>
> fclose ($OpenFile);
>
> for($i=0; $i<count($rader); $i++) {
>
> 	// Delar av olika delar vid <>
> 	$del = explode("<>", $rader[$i]);
>
> 	insert into DBcode...
>
> }
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.808 / Virus Database: 550 - Release Date: 2004-12-08
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux