Results 1 to 9 of 9

Thread: escape input for mysql server

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: escape input for mysql server

    Quote Originally Posted by tpf80 View Post
    What is the proper way to use bindvalue with a "like" query?
    Try:
    SQL Code:
    1. SELECT userid, username, firstname, lastname, email, STATUS
    2. FROM user
    3. WHERE username LIKE '%' || :something || '%'
    To copy to clipboard, switch view to plain text mode 
    or
    Qt Code:
    1. query.bindValue(":something", "%" + somevariable + "%" );
    To copy to clipboard, switch view to plain text mode 

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

    tpf80 (18th June 2007)

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.