Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7557819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:13:54+00:00 2026-05-30T12:13:54+00:00

How do I reset the file pointer with fgetcsv()? I have the loop below,

  • 0

How do I reset the file pointer with fgetcsv()?

I have the loop below, nested inside another while loop. However it starts reading the CSV from the break point rather than the beginning after first run.

while($line2 = fgetcsv($fp2, $length2, $fildDelineate2)) {
        if($line[0] == $line2[0]) {
            $desc = addslashes(strip_tags($line2[6]));
            $import2 = "insert into $table2 values('$id','1',\"$line[1]\",'$desc','','0')";
            mysql_query($import2) or die('import2 '.mysql_error());
            $count++;
            break;
        }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:13:56+00:00Added an answer on May 30, 2026 at 12:13 pm

    You can use rewind() or fseek() to do this:

    rewind($fp2);
    // ...is the same as:
    fseek($fp2, 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to reset a file upload field when the user selects another option.
While reset and checkout have different usages most of the time, I can't see
I want to reset stop word list in mysql for FULLTEXT search. I have
How do I completely reset my Visual Studio 2008 toolbar? Right now I have
I have two classes with a parent-child relationship (customer&order directory&file etc) I have typedef
/** @file ListP.cpp * ADT list - Pointer-based implementation. */ #include <iostream> #include <cstddef>
As I loop through lines in file A, I am parsing the line and
I have a DLL which exports a few functions. The source file contains a
I have a matplotlib figure inside of a wxmpl panel, and am trying to
I have a file, in which each line contains several words that are separated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.