I'm trying to understand a bit how this works. For my example i just simply
want to set a column value to a char. If i know the name of the column how
can id o this. For example the column name i want is 'fname'. I know the
section below with setting myname and then printing it doesnt really make
sense since i could do both of these in one line, just doing that to get a
idea. The `myname = plineInfo[fname];` i'm sure is wrong, it's just there
to give you guys a idea of what i'm trying to get. Were am i going wrong
here?
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 to do but it's only a test */
myname = plineInfo[fname];
printf("fname column was set to %s\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