0

I'm new to this website, and I'm not sure if I'm supposed to ask questions about mysql things in a game server. Anyways, I'm trying to fix this error here, and I was wondering if there's anything I can do to figure out, or solve where the issue is occurring.

    Trace:
        1: Line 32      "Trace" lua/includes/extensions/debug.lua
        2: Line 33      "nil"   gamemodes/catalystrp/gamemode/data.lua
3       C function
        4: Line 84      "nil"   lua/includes/modules/hook.lua


tMySQL query error: Duplicate entry 'STEAM_0:0:53698800' for key 'PRIMARY'Query:
 INSERT INTO metrorp_wallets (`steam`, `rpname`) VALUES('STEAM_0:0:53698800', 'T
Nir Levy
  • 12,750
  • 3
  • 21
  • 38

1 Answers1

0

what this error means is that you are trying to insert a row to the table that conflicts with row already in the table (meaning- there's already a row in the table with the same primary key).

How to deal with this case is really a matter of what you are trying to do. I can think of three ways to go here:

  1. if this case is illegal, than I guess you should not change the query, but handle the error (exception, log, whatever)
  2. if you want to replace the data in the table with the new row, use REPLACE INTO instead of INSERT INTO in your query.
  3. if you want to keep the data that's already there, use INSERT IGNORE in your query.
Nir Levy
  • 12,750
  • 3
  • 21
  • 38