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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:11:28+00:00 2026-06-06T21:11:28+00:00

Am new to SQLite using in iPhone. I have used google and got some

  • 0

Am new to SQLite using in iPhone. I have used google and got some information regarding SQLite for iPhone. I have downloaded the sample source code from here. I have added the code to create table like below,

database = [FMDatabase databaseWithPath:path];
[database open];
[database executeUpdate:@"create table test(name text, message text)"];

And i have used below code to insert values in the table:

    NSString *nameStr = nameText.text;
    NSString *messageStr = ageText.text;

    NSString *executeQuery = [NSString stringWithFormat:@"insert into test values ('%@', '%@')",nameStr, messageStr];
    NSLog(@"Execute Query : %@", executeQuery);
    //[database executeUpdate:executeQuery];

    [database executeUpdate:@"insert into test(name, message) values(?,?)", nameStr,messageStr,nil];

But, the app getting crash in the line [database executeUpdate:@"insert into test(name, message) values(?,?)", nameStr,messageStr,nil]; I can’t get the exact reason for this crash.

If we are using FMDatabase in iPhone is secure and it is preferable for iPhone apps? Can anyone please help on these issues? Thanks in advance.

  • 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-06-06T21:11:30+00:00Added an answer on June 6, 2026 at 9:11 pm

    Use this code

    database = [FMDatabase databaseWithPath:path];
    [database open];
    [database executeUpdate:@"create table test(name text, message text)"];
    [database beginTransaction];
    
    NSString *executeQuery = [NSString stringWithFormat:@"INSERT INTO test (name, message) VALUES (\"%@\", \"%@\")",@"Yuva", @"Hi there",nil];
    NSLog(@"Execute Query : %@", executeQuery);
    [database executeUpdate:executeQuery];
    [database commit];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to using the SQLite database in iphone apps. I have created
I'm new to using sqlite and the iPhone and I'm having some trouble adding
I am new to iPhone programming,need some Help, I am using SQLITE Database In
I am new to using sqlite in iphone, I have an sqlite file saved
I have started using SqLite recently, so I am relatively new to it. I
I have some relatively complex sqlite queries running in my iPhone app, and some
I have an iPhone app that is using sqlite 3.6 (not with FMDB) to
I'm using sqlite as a datasource in an iPhone app. I have two questions
I'm using an SQLite database in my iPhone app. At startup, there are some
I'm using the following code (System.Data.SQLite within VB.net): Dim SQLconnect As New SQLite.SQLiteConnection() Dim

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.