Results 1 to 11 of 11

Thread: INSERT query with MySQL problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    8
    Thanks
    5

    Default INSERT query with MySQL problem

    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):
    Qt Code:
    1. QSqlQuery query;
    2. query.exec("INSERT INTO TradeData (symbol,price,size,time) "
    3. "VALUES ( '"+symbol+"' , '"+price+"' , '"+size+"' , '"+timestamp+"' )");
    To copy to clipboard, switch view to plain text mode 
    attached is a screencap of my compile error

    thanks
    Attached Images Attached Images

Similar Threads

  1. qt4.3.1 mysql problem
    By twells55555 in forum Qt Programming
    Replies: 5
    Last Post: 8th October 2007, 21:26
  2. problem with plugin mysql
    By jose.va18 in forum Installation and Deployment
    Replies: 2
    Last Post: 19th September 2007, 12:12
  3. qt and mysql encoding problem
    By ferasodh in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2007, 09:48
  4. Mysql query question
    By twells55555 in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2007, 23:41
  5. MySQL starting problem
    By shamik in forum General Discussion
    Replies: 5
    Last Post: 25th April 2007, 07:20

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.