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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:03:31+00:00 2026-05-14T00:03:31+00:00

I have taken the data from database into array now I want it to

  • 0

I have taken the data from database into array now I want it to send it back into database by using the insert query.

How can I insert the array of the data into the database?

  • 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-14T00:03:32+00:00Added an answer on May 14, 2026 at 12:03 am

    Inserting into the database is pretty much the reverse of reading from it. You don’t say what the structure of your array is but here is some skeleton code you should be able to adapt to your needs:

    // Assuming you have the sqlite database opened already
    // sqlite3 *sqldb = ...;
    
    // Also assuming you have an array of MyItems holding your data
    // NSMutableArray *items = ...;
    
    sqlite3_stmt *insert_statement;
    
    // Prepare the insert statement
    const char*sql = "INSERT INTO mytable (field1, field2, field3) VALUES(?,?,?)";
    sqlite3_prepare_v2(sqldb, sql, -1, &insert_statement, NULL);
    
    // Iterate over an array of dictionaries
    for (MyItem *item in items) {
    
        // Bind variables - assumed to all be integers
        sqlite3_bind_int(insert_statement, 1, item.field1);
        sqlite3_bind_int(insert_statement, 2, item.field2);
        sqlite3_bind_int(insert_statement, 3, item.field3);
    
        // Execute the insert
        if (sqlite3_step(insert_statement) != SQLITE_DONE) {
            NSLog(@"Insert failed: %s", sqlite3_errmsg(sqldb));
        }
    
        // Reset the statement
        sqlite3_reset(insert_statement);
    }
    
    // release the statement
    sqlite3_finalize(insert_statement);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have taken char data into database into array. now i want to convert
I have data taken from a textarea and put into a database. It is
We have a web application that produces reports. Data are taken from a database.
Hi i have a small query which takes data from one mysql database and
I have a flex app that takes data from a back end database then
I have an array that is taken from an image using exif_read_data($image, 0, true)
i have an array of data from from my database, it looks like this
i m using the following javascript to send the data into database var x=document.getElementById(sortable).innerHTML;
I have a complex Query (Without any locking hints) that takes data from many
I am working on having data taken from a form submit to a database,

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.