Im trying to insert values into a mysql database:
database->queryDatabase("INSERT INTO recordings (title, recording, kit, date) VALUES ('"+recordingTitle+"', '"+ recordingArray +"', '"+kitID+"', '"+recordingDateTime+"')");
database->queryDatabase just sends it to my database connection.
The problem I am having is that:
error: no match for 'operator+' in 'operator+(const QString&, const char*)(((const char*)"\', \'")) + ((Studio*)this)->Studio::recordingDateTime
Each var is of type:
QString recordingTitle;
std::vector<std::pair<int, QString> > recordingArray;
int kitID;
QDateTime recordingDateTime;
How can I add each one to the database? The vector and QDateTime types do not like the + in the query string.
Tahnks
There’s no implicit conversion of
QDateTimetoQString. You’ll need to explicitly convert it:You might have to provide a format specifier to get it into a format MySQL likes.