Regarding MySQL

Discussion in 'Plugin Development' started by amitlin14, Mar 2, 2013.

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

    amitlin14

    A quick question regarding mysql, when i initialize it for the first time, do i need to close the connection?

    When i first initialize it, it checks if the database exists, if it doesnt, it creates it, after that, it checks if the table exists, if it doesnt, it also creates it, but do i need to close the connection? or does it close automatically when the query is finished?
     
  2. Offline

    RainoBoy97

    Im not a SQL expert but. On each query, first check if the connection is open, if not open it. I dont think you need to close it after each query, just do it onDisable and i think you be fine :p
     
  3. Offline

    masacrewayne

    RainoBoy is right, opening the connection each time would introduce more lag, especially if you need to run multiple queries at that time.
     
  4. Offline

    RainoBoy97

    offtopic: thanks for spelling my name right xD always ending up being called rain or rainbow :p

    Woo, Im now an expert on SQL, jk :p
     
Thread Status:
Not open for further replies.

Share This Page