Hi, I'm new to iPhone, I tried to select values from the database, through which I provided everything to sqlite3_bind_int () everything worksfine (). i.e. The database has been opened), but when I compile the line sqlite3_step (statement) it is not fetching it, but according to my query it should get value. I do not know the prices have been tied up.
After values are tied with sqlite3_bind_int () how to check the entire query through NSLog ().
The code below, Plz help me
- (minus) getDataToDisplay: (NSString *) dbPath {if (sqlite3_open ([dbPath UTF8String], and MYDB) = = SQLITE_OK) {const char * sql; Sql = "Choose the address of the doctor's doctor name, address, phone number from where it is between% d and% d."; If (sqlite3_prepare_v2 (MYDB, sql, -1, & amp; mystmt, NULL)! = SQLITE_OK) {NSLOG (@ "add value"); } Sqlite3_bind_int (mystmt, 1,10); Sqlite3_bind_int (mystmt, 2,15); While (sqlite3_step (mystmt) == SQLITE_ROW) Add the name of {[doc object: [NSString stringWithString: [NSString stringWithUTF8String: (char *) sqlite3_column_text (mystmt, 0)]]]]; [Doctor Add addObject: [NSString stringWithString: [NSString string WithUTF8 string (char *) sqlite3_column_text (mystmt, 1)]]]]; [Purpose of connecting the phone number: [NSString stringWithString: [NSString string WithUTF8String: (char *) sqlite3_column_text (mystmt, 2)]]]; }} Sqlite3_reset (mystmt); If (mydb) sqlite3_close (mydb); }
Thanks in advance
You should read SQL: < / P>
sql = "Choose name, address, phone number from the list of doctors, where 1 more?