Results 1 to 7 of 7

Thread: QT MySQL

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2007
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT MySQL

    Yes, I include these header files,

    #include <qapplication.h>
    #include "/usr/include/mysql/mysql.h"
    #include <qsqldatabase.h>
    #include <qsqlquery.h>

    ok i solve the problem.


    But now I had occure another one

    I wand to execute a query in QT.
    The following is the code...

    ================================================== ==
    double id, mark1, mark2, mark3, total;
    const char *name;
    name = TxtName->text();
    mark1 = TxtMark1->text().toDouble();
    mark2 = TxtMark2->text().toDouble();
    mark3 = TxtMark3->text().toDouble();
    id = TxtMark4->text().toDouble();

    total = mark1 +mark2+mark3;

    QSqlQuery target;

    QString sql = "insert into student ( s_id, s_name, s_mark1, s_mark2, s_mark3, s_total ) values( " ;

    ==================================================

    After this i am stuck!!!!!!!!!!!
    how can i add the values of the variables to that string ' sql ' ?

    please help me......

    sabeesh




    ================================================== ===






    Sabeesh
    Last edited by sabeeshcs; 11th January 2007 at 06:11.

Similar Threads

  1. Deploying with MySQL support under Windows
    By KShots in forum Installation and Deployment
    Replies: 1
    Last Post: 12th October 2006, 09:19
  2. Qt and MySQL Database Connection
    By shamik in forum Qt Programming
    Replies: 41
    Last Post: 6th October 2006, 12:48
  3. MYSQL Triggers??
    By allensr in forum General Programming
    Replies: 1
    Last Post: 2nd October 2006, 21:54
  4. Qt 4.1.4 & Mysql 5 on Linux x64
    By bothapn in forum Installation and Deployment
    Replies: 7
    Last Post: 4th August 2006, 13:23

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.