Name: Anonymous 2009-07-21 17:27
I have been trying to save this string to the SQLite database for a while now and no luck online! I am using Visual Studio 2008 and using a SQLite C++ class. Here is my code:
int main()
{
std::string s;
SQLITE3 sql("apptz.sql");
string hey = "heyy";
//This works when I manually input text
sql.exe("INSERT INTO appts (title) VALUES ('First Appt.')");
//This does not work when I use the variable name instead of manually
sql.exe("INSERT INTO appts (title) VALUES (hey)");
return 0;
}
If you can help it will be greatly appreciated. Thank you!
int main()
{
std::string s;
SQLITE3 sql("apptz.sql");
string hey = "heyy";
//This works when I manually input text
sql.exe("INSERT INTO appts (title) VALUES ('First Appt.')");
//This does not work when I use the variable name instead of manually
sql.exe("INSERT INTO appts (title) VALUES (hey)");
return 0;
}
If you can help it will be greatly appreciated. Thank you!