hey everybody
im a bit of a newb to Qt so keep that in mind
I'm trying to make an application that sends data to a MySQL database
i can successfully send data using the INSERT INTO statement, but it does not compile when i try to use variables for the data values
the variables i am using are strings and the fields i am trying to insert them into are all varchar(20)
here is my code (which i found by searching this forum):
query.exec("INSERT INTO TradeData (symbol,price,size,time) "
"VALUES ( '"+symbol+"' , '"+price+"' , '"+size+"' , '"+timestamp+"' )");
QSqlQuery query;
query.exec("INSERT INTO TradeData (symbol,price,size,time) "
"VALUES ( '"+symbol+"' , '"+price+"' , '"+size+"' , '"+timestamp+"' )");
To copy to clipboard, switch view to plain text mode
attached is a screencap of my compile error
thanks
Bookmarks