View Single Post
  #10 (permalink)  
Old 02-24-06, 06:23 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
For the file name, use something like this - $filename = "/secured_path/filename";

Where "one" appears now, change this to $filename

The author's code appends the .csv so your file name variable does not include it.

Only the price up to the , is printed, as the , is the field delimiter. The authors code is not sophisticated enough to ignore , located within quoted data. You will need to either change the number format in the csv to eliminate the , in the price or modify the author's code.

For removing the " on the display, change this function near the bottom of the author's include file -
PHP Code:

function _getLineArray($filename)

    {
    
$f fopen($filename"rb");
    
flock($f,LOCK_EX);

    
fseek($f,0,SEEK_END);
    
$filesize ftell($f);
    
fseek($f,0,SEEK_SET);
    
$dbVar trim(fread($f,$filesize));
    
flock($f,LOCK_UN);
    
fclose($f);
    
$dbVar explode("\n"$dbVar);
      
$dbVar str_replace("\""""$dbVar); <---- ADD THIS LINE ------------
    return 
$dbVar;
    } 
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote