SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error:( Missing Format Variable ) when reading csv file

    Hi

    i'm trying to read a csv file located on another server...It seam to open the file without problem but when i want to display the data, it give me this error: Missing Format Variable.

    Does anyone know why i have this error? The same code but pointing to a local file works fine...

    Here is the code....taken on php.net...

    PHP Code:
    $row 1;
    $handle fopen("http://finance.yahoo.com/d/quotes.csv?s=MANS.OB&f=sl1d1t1c1ohgv&e=.csv""r");
    while ((
    $data fgetcsv($handle1000",")) !== FALSE) {
       
    $num count($data);
       echo 
    "<p> $num fields in line $row: <br /></p>\n";
       
    $row++;
       for (
    $c=0$c $num$c++) {
           echo 
    $data[$c] . "<br />\n";
       }
    }
    fclose($handle); 
    Thanks...

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok found it....Replace the '&amp;' in the link with &.....That's it!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •