Re: Problem with database
- Posted by Derek Parnell <ddparnell at bigpond.com> Dec 21, 2004
- 452 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