Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Write data to a MySQL database [Solved]
Qt 6.11 is out! See what's new in the release blog

Write data to a MySQL database [Solved]

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wimschuiteman
    wrote on last edited by
    #1

    Hello

    I have made ​​a program that connects to a MySQL database. and read the data from the database.
    This works well.
    But how can i wirte data to the dataBase
    When I search with google I find only information about the MySQL driver.

    Can anybody help me?

    Regards,
    Wim

    Regards,
    Wim

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jake007
      wrote on last edited by
      #2

      You have a standard query, with INSERT INTO statement.
      "SQL INSERT INTO reference":http://www.w3schools.com/sql/sql_insert.asp


      Code is poetry

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wimschuiteman
        wrote on last edited by
        #3

        I want to write QString to an existing cell.
        But not add a new row.

        Regards,
        Wim

        1 Reply Last reply
        0
        • D Offline
          D Offline
          d2uriel
          wrote on last edited by
          #4

          "SQL UPDATE statement":http://www.w3schools.com/sql/sql_update.asp

          "Do not judge, and you will never be mistaken." - Jean-Jacques Rousseau

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Skyrim
            wrote on last edited by
            #5

            Hi
            connect to database
            @
            dBase = QSqlDatabase::addDatabase("QMYSQL");
            dBase.setDatabaseName("name_database");
            dBase.setHostName("127.0.0.1"); // ip or host
            dBase.setUserName("root"); //user_name
            dBase.setPassword("pass"); //
            dBase.open();
            @
            and with a requests to write or read data from database.
            For help read this "tread":http://qt-project.org/forums/viewthread/15037/

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved