Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8948527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:00:59+00:00 2026-06-15T13:00:59+00:00

Im trying to insert values into a mysql database: database->queryDatabase(INSERT INTO recordings (title, recording,

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:01:00+00:00Added an answer on June 15, 2026 at 1:01 pm

    There’s no implicit conversion of QDateTime to QString. You’ll need to explicitly convert it:

    database->queryDatabase("INSERT INTO recordings (title, recording, kit, date)"
        " VALUES ('" + recordingTitle + "', '" + recordingArray +"', '" + kitID + 
            "', '" + recordingDateTime.toString() + "')");
    

    You might have to provide a format specifier to get it into a format MySQL likes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to insert values with Unicode Chars into a MySQL-database using Delphi 2010 and
I'm trying to insert values from my asp.net application into my MySQL database. On
I am trying to insert a date from a variable into a mysql database.
I'm trying to INSERT INTO a mySQL database and I'm getting this error on:
I am trying to insert a lot of fields into a MySQL database, some
I'm trying parse an xml file and insert it into an mysql database. The
I'm trying to insert a ton of rows into my MySQL database. I have
I'm trying to insert text into a MySQL DataBase from a form using PHP.
I am trying to implode some variables and insert them into a MySql database,
I'm trying to insert a tuple into a mySQL database in the following manner.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.