MySQL connect with my plugin

Discussion in 'Plugin Development' started by MrFiliper, Jan 19, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    MrFiliper

    Hello, I search in google mysql connection tutorials, but not working. Please help my, send my link to working MySQL connect or create small code.

    Thanks.
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    Just_Jitse

    Nonono, we are not here to spoonfeed you, we are only gonna help you. But in the end, you need to write it yourself.


    to 1min.
     
  4. Offline

    JEREMSPEED

    Hello,

    I'd like to add something. After some idle time, (28800s by default) the server will automatically kill the connection. So you will have to check if the connection is still alive before any of your queries (including prepared statements)
    Code:
                if (connection == null || !connection.isValid(4) || connection.isClosed())
                    connect();//Reinstanciating your Connection object
    If you're wondering what is "4", take a look at the doc!
     
Thread Status:
Not open for further replies.

Share This Page