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 6985277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:39:35+00:00 2026-05-27T18:39:35+00:00

I have 500 rows in CSV. 400 Is inserted and 401 is duplicate, it

  • 0

I have 500 rows in CSV. 400 Is inserted and 401 is duplicate, it does not allow me to insert after 401 the rest. I need to manually find the CSV file and edit it.

But how can i tell Zend_Db adapter, on duplicate continue next one, if next one is also duplicate continue to next one, but do not exit unless all rows are scaned.

Example:

  $row = Application_Model_Csv::processFile("/var/tmp/csv.csv");
  foreach($row as $k=>$v)
  {
    $insert =array(
      'groups' => $v[0],
      'country'=> $v[1],
      'name' =>$v[2],    /* Unique key */
      'url' => $v[3]
    );
    $this->db->insert("something", $insert);
  } 
  • 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-27T18:39:36+00:00Added an answer on May 27, 2026 at 6:39 pm

    You can use REPLACE instead of INSERT. Zend Framework doesn’t have specific method for this, but you can make a custom query:

    $this->db->getAdapter()->query('REPLACE INTO `something` (`groups`, `country`, `name`, `url`)
    VALUES ("' . $v[0] . '", "' . $v[1] . '", "' . $v[2] . '", "' . $v[3] . '")');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with just 400-500 rows but this table is being accessed
Suppose I have 500 rows of data, each with a paragraph of text (like
I have this table: id feed_id ... Let's say that I have 500 rows
I have a simple HTML Table (10 columns x 500 rows). When the page
I have both matrices containing only ones and each array has 500 rows and
here is a simple problem. I have a table of 500 rows and what
I have 500 images named Image1.tif all the way to Image500.tif and I need
We have a 5GB table (nearly 500 million rows) and we want to remove
We have a (currently InnoDB) table which contains roughly 500,000 rows. This represents a
I have 500 CSV files in this format: IndicatorA_Name.csv 1900 1901 1902 ... Norway

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.