Hello Everyone,
I am using sprintf() to combine my text entrys on my GTK Application to insert into a sqlite database. it connects just fine to the database but it won't insert the text from the entrys and the time. Any Suggestions?
Code:
time_t t = time(0);
rc = sqlite3_open("src/myprogramdatabse.db3", &db);
char cmd[200];
sprintf(cmd,"INSERT INTO os_basics VALUES (%s, %s, %s, %s, %s)",ctime(&t), gtk_entry_get_text(GTK_ENTRY(entry_os_name)), gtk_entry_get_text(GTK_ENTRY(entry_os_id)), "variable", gtk_entry_get_text(GTK_ENTRY(entry_os_version)));
if (rc == SQLITE_OK)
{
rc = sqlite3_exec(db, cmd, callback, 0, &zErrMsg);
}
Thank You