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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
teion
Wanderer


Joined: 03 May 2005
Posts: 72

PostPosted: Fri Jan 30, 2015 9:23 pm   

sql database problems
 
I am a complete newb when it comes to databases but I want to learn. I am trying to search my database to return a field. At this point I am only interested in returning values.
When I try to search the database i get and infinite loop of : output.

The name of my database is test.db the Table name is Items with fields Short Name, Name

Here is the code I am using to try to search the database

Code:
#SQLDB test.db
$row = %sql(test, "SELECT * FROM Items")
#WHILE (!$row.EOF()) {#SHOW $row.Item("Short Name") " : " $row.Item("Name");#CALL $row.Next}


the database is stored in the cmud directory and I also made a copy in the directory of the mud that I play on. Any help appreciated
Reply with quote
teion
Wanderer


Joined: 03 May 2005
Posts: 72

PostPosted: Fri Jan 30, 2015 10:02 pm   
 
after further looking into the issue sqlite browser is not saving the database as a .db so its on my end.
Reply with quote
Stowslee
Wanderer


Joined: 20 Apr 2008
Posts: 69
Location: Watervliet, NY

PostPosted: Mon Feb 02, 2015 2:16 am   
 
I personally found it to be useful to initially create the database through CMUD, then open it via SQLite in order to manipulate it. This ensures that the database is saved in the right location, and with the proper file name.

Probably just the lazy way to do it, but it works for me.
Reply with quote
teion
Wanderer


Joined: 03 May 2005
Posts: 72

PostPosted: Mon Feb 02, 2015 9:06 pm   
 
Thanks for the advise. I ended up doing the same thing and I finally figured out how to search the database.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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