Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: Alice on February 05, 2015, 02:44:53 pm

Title: [SOLVED] An issue with Queries
Post by: Alice 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 (http://modcraft.io/viewtopic.php?f=60&t=8887&view=unread#unread" onclick="window.open(this.href);return false;)

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.
Title: Re: An issue with Queries
Post by: Ascathos 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.
Title: Re: An issue with Queries
Post by: Amaroth 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.
Title: Re: An issue with Queries
Post by: Alice 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.