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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:04:11+00:00 2026-05-26T01:04:11+00:00

in my project im using a database.There are almost 365 questions in that.so i

  • 0

in my project im using a database.There are almost 365 questions in that.so i want to get a particulat question for a particular day.i used the code below to fetch a qusestion from database.

-(void)print{
    sqlite3_stmt *statement;


   // SELECT * from light where rowid = %i",1
        qsql=[NSString stringWithFormat:@"Select * from ishh where col_1 = '365'"];


        if(sqlite3_prepare_v2(database, [qsql UTF8String], -1, &statement, NULL) == SQLITE_OK) {
            NSLog(@"%dsssssssssssssss",sqlite3_step(statement));
            NSLog(@"%ddddddddddddddddddddd", (SQLITE_ROW));
            NSString *Q_NO = [[NSString alloc] initWithUTF8String:(char *)sqlite3_column_text(statement, 1)];
            NSLog(@"%@ gg",Q_NO);

when i use the above code it is printing the correct question from database.Also when i give the statement like qsql=[NSString stringWithFormat:@”Select * from ishh where col_1 = ‘1’”]; it is not fetching the question.
But when i use the below code it is not fetching from the database.

-(void)print{
    sqlite3_stmt *statement;

   // SELECT * from light where rowid = %i",1
        qsql=[NSString stringWithFormat:@"Select * from ishh where col_1 = '1'"];


        if(sqlite3_prepare_v2(database, [qsql UTF8String], -1, &statement, NULL) == SQLITE_OK) {
            NSLog(@"%dsssssssssssssss",sqlite3_step(statement));
            NSLog(@"%ddddddddddddddddddddd", (SQLITE_ROW));
            NSString *Q_NO = [[NSString alloc] initWithUTF8String:(char *)sqlite3_column_text(statement, 1)];
            NSLog(@"%@ gg",Q_NO);
            while (sqlite3_step(statement) == (SQLITE_ROW))
            { 
                NSLog(@" iolo");
                 NSString *Q_NO = [[NSString alloc] initWithUTF8String:(char *)sqlite3_column_text(statement, 1)];
                //NSString *Q_NO = [[NSString alloc] initWithString:[NSString stringWithFormat:@"%i",sqlite3_column_int(statement, 0)]];

                NSLog(@"%@ gg",Q_NO);


            }  
            sqlite3_reset(statement);

        }
    sqlite3_finalize(statement);
    }

             Can anyone tell me where im going wrong.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-05-26T01:04:11+00:00Added an answer on May 26, 2026 at 1:04 am
    -(void)print{
        sqlite3_stmt *statement;
        qsql=[NSString stringWithFormat:@"Select * from ishh where col_1 = '1'"];
    
        if(sqlite3_prepare_v2(database, [qsql UTF8String], -1, &statement, NULL) == SQLITE_OK) {
            while (sqlite3_step(statement) == (SQLITE_ROW))
            { 
                char *field0 = (char *)sqlite3_column_text(statement, 0);
                char *field1 = (char *)sqlite3_column_text(statement, 1);
                NSString *Q_NO = nil;
                if(field0!=NULL){
                    Q_NO = [[NSString alloc] initWithUTF8String:field0];
                }
                NSString *Q_NO1 = nil;
                if(field1!=NULL){
                    Q_NO1 = [[NSString alloc] initWithUTF8String:field1];
                }
                NSLog(@"%@ %@",Q_NO, Q_NO1);
    
                [Q_NO release];
                [Q_NO1 release];
            }  
        }
        sqlite3_finalize(statement);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using MySQL database and JSP for a project. In my project there
I'm working on a project that is considering using Cassandra as a database. We
When trying to deploy a VS2010 database project using the VSDBCMD tool, I get
I'm working on a C# project using a SQL Server 2008 database. There are
I just got off a small project using a WCF/REST Web Service that used
My team working in a project using Winforms application(c#) & MSSQL 2005 as database.
At work, we recently started a project using CouchDB (a document-oriented database). I've been
In a project we are using CodeSmith to generate database layer, Codesmith seperate creates
I have a Java project connecting to an Ingres database and using the Spring
We are looking at using a NoSQL database system for a large project. Currently,

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.