PDA

View Full Version : combined containers sql guide


Sensu-Bean
03-18-2005, 07:06 PM
Hi,

Its been awhile since Ive posted, few may remember my post scripting the monk epic in perl awhile ago. However, I never really did much after I scripted it. Eventually Id like to complete it by adding the sql for the containers. Which brings me to this post.

Ive been working on alot of quests from live that at some point use items in a combine container to get a filled container for the quest handin. For example Ill post some sql below:

----
#item you'll get after container is combined.
INSERT INTO tradeskill_recipe (name,tradeskill,skillneeded,trivial,nofail,
replace_container,notes) VALUES ('Filled Penance Bag,69,0,0,1,0);

#container to combine items in
INSERT INTO tradeskill_recipe_entries (recipe_id,item_id,successcount,failcount,
componentcount,iscontainer) VALUES (0000,17091,0,0,0,1);

#8 bone fragments to be combined in container
INSERT INTO tradeskill_recipe_entries (recipe_id,item_id,successcount,failcount,
componentcount,iscontainer) VALUES (0000,24769,0,0,8,0);
----

what I dont understand is the recipe_id, which I typed 0000, above. The recipe_id's will all be the same number for the container and bone fragments, but how do you figure out what the recipe_id is if this recipe doesnt exist in the database yet? Im just using the mysql terminal, and still in the process of learning so any help would be greatly appreciated. any quick guides, tips, etc...

Sensu-Bean

knightz
03-21-2005, 03:53 AM
The recipe ID is the ID of:
INSERT INTO tradeskill_recipe (name,tradeskill,skillneeded,trivial,nofail,
replace_container,notes) VALUES ('Filled Penance Bag,69,0,0,1,0);

Which is auto incremented after you insert it.

Sensu-Bean
03-21-2005, 06:27 AM
ok, so what your saying is after i insert this line:

INSERT INTO tradeskill_recipe (name,tradeskill,skillneeded,trivial,nofail,
replace_container,notes) VALUES ('Filled Penance Bag,69,0,0,1,0);

the recipe_id is automatically adjusted to a certain number. my question is how can I find out what that number was set to. because where the 0000 is after VALUES in the post below is the same recipe_id that it was set to above. how can i find this number? still learning sql.

#8 bone fragments to be combined in container
INSERT INTO tradeskill_recipe_entries (recipe_id,item_id,successcount,failcount,
componentcount,iscontainer) VALUES (0000,24769,0,0,8,0);

knightz
03-21-2005, 08:08 AM
SELECT id FROM tradeskill_recipe WHERE name='Filled Penance Bag';

That will give you the id of the recipe, then just that id in place of 0000 in the other queries.

Sensu-Bean
03-21-2005, 08:37 AM
ahhh.. I see.

I was doing this:

SELECT recipe_id FROM tradeskill_recipe WHERE name='Filled Penance Bag';

instead of doing:

SELECT id FROM tradeskill_recipe WHERE name='Filled Penance Bag';

thanks for the help :)