Anybody help me out here, trying to grab column info based on the columns
name. Examples i keep seeing people seam to use the colunm number but cant
you access these values by the name?
int main(void)
{
char myname[50];
sqlite3 *db;
sqlite3_stmt *plineInfo = 0;
if(sqlite3_open("my.db", &db) != SQLITE_OK) {
return 0;
}
if(sqlite3_prepare(db, "SELECT * FROM mytable", -1, &plineInfo, 0) !=
SQLITE_OK) {
return 0;
}
while((rc = sqlite3_step(plineInfo)) == SQLITE_ROW) {
/* i know this doesnt make much sense, just a example showing what
i'm after */
myname = plineInfo[fname];
printf("the column fname has the value of %s stored in it\n",
myname);
}
sqlite3_finalize(plineInfo);
sqlite3_close(db);
return 1;
}
~Shaun
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users