Results 1 to 8 of 8

Thread: [Qt/Sql] SQL Authentification : what query execute ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [Qt/Sql] SQL Authentification : what query execute ?

    Think a little. In the first email you know how to read a value from the database and now not ?
    Qt Code:
    1. QSqlQuery query;
    2. query.prepare("SELECT COUNT(*) FROM profil WHERE pseudo = :pseudo");
    3. query.bindValue(":pseudo", pseudo->text());
    4. if(query.exec())
    5. {
    6. query.first();
    7. if( query.value(0).toInt() == 0 )
    8. {//not found
    9. }
    10. else
    11. {//found
    12. }
    13. }
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to Lesiok for this useful post:


Similar Threads

  1. Lua + C++ Function Execute
    By steadi in forum Newbie
    Replies: 1
    Last Post: 2nd December 2012, 17:44
  2. QSqlQuery does not execute
    By weixj2003ld in forum Qt Programming
    Replies: 7
    Last Post: 11th July 2012, 12:13
  3. Execute a .sql file with more than one query
    By ShadowBelmolve in forum Newbie
    Replies: 6
    Last Post: 19th August 2010, 16:48
  4. Can execute examples
    By gyre in forum Qwt
    Replies: 12
    Last Post: 26th February 2010, 08:51
  5. Replies: 2
    Last Post: 5th March 2008, 10:39

Tags for this Thread

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.