Solved A litle SQL Help :3

Discussion in 'Plugin Development' started by mine-care, Apr 21, 2015.

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


    Hello there, i have been playing with SQL lately and i am trying to implement it to my code. All works perfectly but there is a problem, When the statement is called:
    "INSERT INTO tablename (`UUID`, `Kills`) VALUES(...)" it works perfectly fine but it creates doubles. How can i replace an entity if the UUID exists? Like if the UUID exists and kills differ, i want it replaced.
    Thanks a ton.
  2. Offline


  3. Offline


    @undeaD_D Ty! =D no i had never heard... i got into SQL today at school where our teacher gaves an intro but it was for like 20 minutes so as Homework we had to practice and find practical uses :3
    Ill look at it.
  4. Offline


  5. Offline



    Also, you can create queries of the form:

    INSERT INTO .... ON DUPLICATE KEY UPDATE [key] = [value] [, [key] = [value]]

    So that way collisions on the primary key do not cause errors, but rather are automatically transformed into updates.
  6. Offline


Thread Status:
Not open for further replies.

Share This Page