Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Thu Sep 07, 2006 12:43 am   

database problem
 
OK, I have a database called Fox. it is an equipment database that I've been messing around with for a long time, and just deleted all of the records in it a while ago... Anyway, I just added two records to it, numbers 2187 which is a hat and 2188 which is a ring. If i do a #show %query( (&Name=%-1), All) assigned to an alias called comptest then enter comptest ring, it returns 2188fo as it should, but when i enter comptest hat it returns 2187fo|2188fo....... I have no idea why other than that this database has been extremely quirky since ive started trying to set it up. Any idea why this might be happening?
Also, even though I delete all of the records, I still start with record number 2187 or whatever... is there any way to delete all of the records and reset the record number to 1?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Thu Sep 07, 2006 12:59 am   
 
delete the database file and/or start a new database
_________________
Discord: Shalimarwildcat
Reply with quote
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Thu Sep 07, 2006 1:34 am   
 
Ok here's another part of the problem I thought was too lengthy to ask for help on this board... but why not!
for this same dabase I populate it by arming a number of triggers each populating an item field such as item.name item.wearlocation item.minlevel etc... when I do this, if I try to write to the database with the same record twice, it changes one or both of the name fields of the records to 0... here is the code I use.
Code:
#LO autoidbackup.txt
#class autoid 1
#var actemp ""
#var item ""
recite identify %1
;#show this is dbitem @dbitem
#var item.whoid %char
#var item.iddate %time( mm/dd/yy)
#wa 5000
;#IF (!%null( @Item)) {#NEW All @Item}
say @item
#class autoid 0
#show @item.name
#show @item.itemtype
#show @item.minlevel
#VAR dbCompare %query( ((&Name=@Item.name)&(&ItemType=@Item.itemtype)&(&MinLevel=@Item.minlevel)), All)
#show dbcompare @dbcompare
#VAR dbDoesExist 0
#show dbdoesexist @dbdoesexist
#IF (!%null( @dbCompare)) {dbDoesExist=1}
#show dbitem @item
#show dbdoesexist @dbdoesexist
#IF (@dbDoesExist) {#YESNO "This record already exists in the current Database. Are you sure you want to add it?" {
    #show @item
    #NEW All @Item
    } {No:#NOOP}} {
  #show @item
  #NEW All @Item
  }
#lo
#file 1 foxbigeq
#write 1 @item
ff @item.name

Any help on why this might be populating the name to 0 or how to fix it would help... I've been trying to fix it but I cant get the query part correct hence my first question up above... As far as deleting the database, is there a way to do so but to export/import the layout and fields of the database?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net