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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:33:40+00:00 2026-05-31T15:33:40+00:00

I dont know the exact problem but have been scratching my head for almost

  • 0

I dont know the exact problem but have been scratching my head for almost 4 hrs now.

    if (sqlite3_open([dataBasePath UTF8String], &bookDB) == SQLITE_OK) {


    NSString *Query = [NSString stringWithFormat:@"SELECT * FROM linktable WHERE pageid = 2"];

    if (sqlite3_prepare_v2(bookDB, [Query UTF8String], -1, &statement1, nil) == SQLITE_OK) {

        markupsArray = [NSMutableArray arrayWithCapacity:1];

        NSLog(@"sqlite3_step(statement1) is %d",sqlite3_step(statement1));

        while (sqlite3_step(statement1) == SQLITE_ROW) {
            NSLog(@"yup");

            MarkupData *markUpObject = [[MarkupData alloc] init];

            markUpObject.linkID =  [[[NSString alloc] initWithUTF8String:(const char*) sqlite3_column_text(statement1, 0)] autorelease];
            markUpObject.pageID =  [[[NSString alloc] initWithUTF8String:(const char*) sqlite3_column_text(statement1, 1)] autorelease];
            markUpObject.markupID =  [[[NSString alloc] initWithUTF8String:(const char*) sqlite3_column_text(statement1, 2)] autorelease];
            markUpObject.folioNumber =  [[[NSString alloc] initWithUTF8String:(const char*) sqlite3_column_text(statement1, 5)] autorelease];


            [markupsArray addObject:markUpObject];
        }
    }
}

Here comes the strange thing. The value of sqlite3_step(statement1) is 100, so is the value of SQLITE_ROW. But even then the while loop is not getting executed. Can any one help me crack this strange scenario please… Just got struck up here.. 🙁

  • 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-31T15:33:42+00:00Added an answer on May 31, 2026 at 3:33 pm

    If your sqlite query is returning just 1 record, the sqlite3_step() actually steps through the record. Since you have your NSLog statement executing sqlite3_step(), the record is already stepped through here. Hence, your while loop won’t execute as there are no more rows to step through.

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

Sidebar

Related Questions

I don't know the exact problem. I am using flex mx:tree component in flex
I dont know if I'm right, but allmost everytime I read about obfuscation and
I dont know what happend but I cant register any dlls anymore. It seems
This has probably been answered before, but I have spent some time looking and
The problem is that the two sections are sometimes empty, so I dont know
I know variants of this question have been asked frequently before (see here and
This should be a simple problem but I can't seem to find an exact
This problem might be a common one, but since I don't know the terms
I know this has probably already been answered, but I can't find it easily
i have been having this issue for some time now, and have not gotten

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.