1. Problem with database
- Posted by Jacen <Duel_Saber72 at hotmail.com> Dec 21, 2004
- 479 views
I'm having a problem in my game with the database. I'm creating a MUD game (or trying to anyways) and am saving my items in a database. Each item has its own table. When I try to delete the table to show the item isn't there, the table comes back after I move to another location. I've set up an error code to come up if the table isn't deleted(see code below), but nothing comes up, so supposedly the table hasn't been deleted.
if find(item[1][2], table_list) then -- name of item, also name of table db_delete_table(item[1][2]) else puts(1,"Table doesn't exist!") -- this never comes up, so the table end if -- should have been deleted.
2. Re: Problem with database
- Posted by Jacen <Duel_Saber72 at hotmail.com> Dec 21, 2004
- 467 views
Sorry, forgot to tell you the name of the file. It's Groundwork for a TBAG or something like that, in the Recent Users Contributions
3. Re: Problem with database
- Posted by Derek Parnell <ddparnell at bigpond.com> Dec 21, 2004
- 453 views
Jacen wrote: > > I'm having a problem in my game with the database. I'm creating a MUD game > (or trying to anyways) and am saving my items in a database. Each item has > its own table. When I try to delete the table to show the item isn't there, > the table comes back after I move to another location. I've set up an error > code to come up if the table isn't deleted(see code below), but nothing > comes up, so supposedly the table hasn't been deleted. > }}} <eucode> > if find(item[1][2], table_list) then -- name of item, also name of table > db_delete_table(item[1][2]) > else > puts(1,"Table doesn't exist!") -- this never comes up, so the table > end if -- should have been deleted. > </eucode> {{{ I assume that 'table_list' is a sequence of items (tables) that you have built somewhere else. If so, then after you delete the table, you should also remove the table name form the 'table_list' sequence. However, an alternate way of doing this is ...
if find(item[1][2], db_table_list() ) then -- name of item, also name of table db_delete_table(item[1][2]) else puts(1,"Table doesn't exist!") -- this never comes up, so the table end if -- should have been deleted.
-- Derek Parnell Melbourne, Australia