This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [SOLVED] An issue with Queries  (Read 1141 times)

Alice

  • Registred Member
  • Race Changer
  • *****
  • Posts: 28
    • View Profile
[SOLVED] An issue with Queries
« on: February 05, 2015, 02:44:53 pm »
In my previous post i asked about a issue adding classes.

viewtopic.php?f=60&t=8887&view=unread#unread

That problem is already solved.
But I still need to know if I can delete a query that does not allow me to create human hunters.

The issue is specifically the following: By mistake i created two queries for human hunters. And if I'm not mistaken now i should delete one of them, to make that this class/race combo works properly.

So, how do I find a query and delete it?

That's all, thanks again in advance.
« Last Edit: February 08, 2015, 10:20:03 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: An issue with Queries
« Reply #1 on: February 05, 2015, 11:45:25 pm »
Error Code: 1062
Duplicate entry '1-3-1' for key 'PRIMARY'



Those queries did not apply, thus. Else, paste me the error please.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Amaroth

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 1219
    • View Profile
    • Amaroth's Tools
Re: An issue with Queries
« Reply #2 on: February 05, 2015, 11:56:32 pm »
Error you get jsut says that you are trying to add row which already exists in that table, meaning that adding new row was unsuccesful (and original is kept unedited in this case). If you have executed 2 same insert queries, the first one was succesful, added rows which it was supposed to add and only the second one was unsuccesful.

That just means that rows were succesfuly added. You don't need to delete any "queries". You have to understand what primary key is - when table has primary key (lets say it will be one called ID) it in fact doesn't have rows which have some data stored in ID column. In fact that table is made of unique IDs and those IDs may include (up to one) row with some other data. 1, 2 or 50 same executed insert queries will always lead just to one thing - the first one will add new rows (if all IDs used in that query are currently empty and unused) and all next will just crash and do nothing.

Imagine combination of race, class and level as one ID (in our case 1-3-1 for human hunter lvl 1). First query created him, the second crashed. No need to worry about him anymore, he is there and thats just all. Nothing unwanted to delete or something like that.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
English YT tutorial channel. Check it out if you preffer videos over walls of text.:
https://www.youtube.com/AmarothEng

Want to support me for my releases and/or tutorials? You can send donation via Paypal to:
jantoms@seznam.cz

Alice

  • Registred Member
  • Race Changer
  • *****
  • Posts: 28
    • View Profile
Re: An issue with Queries
« Reply #3 on: February 07, 2015, 08:42:53 am »
Thanks again here Amaroth. For now i just started all over again. But also i'll check the things you said.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »