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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:53:51+00:00 2026-05-30T23:53:51+00:00

I’m trying to insert this – (void)insertBlogStory:(NSString *)storyTitle link:(NSString *)link storyDescription:(NSString *)storyDescription storyHTML:(NSString *)storyHTML

  • 0

I’m trying to insert this

- (void)insertBlogStory:(NSString *)storyTitle link:(NSString *)link storyDescription:(NSString *)storyDescription storyHTML:(NSString *)storyHTML pubDate:(NSString *)pubDate blog:(NSString *)blog {

    NSLog(@"storyTitle %@",storyTitle);
    NSLog(@"link  %@",link);
    NSLog(@"storyDescription  %@",storyDescription);
    NSLog(@"storyHTML  %@",storyHTML);
    NSLog(@"pubDate  %@",pubDate);
    NSLog(@"blog  %@",blog);

    if(addStmt == nil) {

        const char *sql = "insert into contents (storyTitle, link, storyDescription, storyHTML, pubDate, blog, read) VALUES (?, ?, ?, ?, ?, ?, ?)";

        if(sqlite3_prepare_v2(_database, sql, -1, &addStmt, NULL) != SQLITE_OK)
            NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(_database));
    }

    sqlite3_bind_text(addStmt, 1, [storyTitle UTF8String], -1, SQLITE_TRANSIENT);
    sqlite3_bind_text(addStmt, 2, [link UTF8String], -1, SQLITE_TRANSIENT);
    sqlite3_bind_text(addStmt, 3, [storyDescription UTF8String], -1, SQLITE_TRANSIENT);
    sqlite3_bind_text(addStmt, 4, [storyHTML UTF8String], -1, SQLITE_TRANSIENT);
    sqlite3_bind_text(addStmt, 5, [pubDate UTF8String], -1, SQLITE_TRANSIENT);
    sqlite3_bind_text(addStmt, 6, [blog UTF8String], -1, SQLITE_TRANSIENT);
    sqlite3_bind_int(addStmt,  7, 0);

    if(SQLITE_DONE != sqlite3_step(addStmt))
        NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(_database));

    sqlite3_reset(addStmt);


}

Which prints out correct values being sent to the methiod

storyTitle -> Converged Security
link -> http://...converged-security.html
storyDescription -> Cyber-crime is not new....etc
storyHTML -> <p>Cyber-crime is not new....etc
pubDate -> Thu, 01 Sep 2011 10:52:57 +0100
blog -> Business continuity

The sqlite table looks like this

TABLE "contents" (
"id" INTEGER PRIMARY KEY,
"storyTitle" TEXT,
"link" TEXT,
"storyDescription" TEXT,
"storyHTML" TEXT,
"pubDate" DATETIME,
"blog" TEXT,
"read" INTEGER,
"storyVideo" TEXT,
"storyVideoThumb" TEXT,
"storyAudio" TEXT,
"issueA" TEXT,
"industryA" TEXT,
"serviceA" TEXT,
"contactName" TEXT,
"contactPhone" TEXT,
"contactAddress" TEXT,
"contactPhrase" TEXT,
"contactPhraseEmail" TEXT,
"contactPhraseName" TEXT
);

But this is what is inserted

"storyTitle" correct string
"link" correct string
"storyDescription" correct string
"storyHTML" correct string
"pubDate" correct string
"blog" is always NULL
"read" is always NULL


"storyVideo" gets the blog string (Business continuity)
"storyVideoThumb" gets the read value (0)

Why is it inserting the last two values into the wrong fields?

TIA

  • 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-30T23:53:52+00:00Added an answer on May 30, 2026 at 11:53 pm

    for the fame and glory (and points):

    addStmt looks to be static and/or global. i would guess you are using the same variable name elsewhere with a slightly different insert statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string

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.