|
teion Wanderer
Joined: 03 May 2005 Posts: 72
|
Posted: 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 |
|
|
|
teion Wanderer
Joined: 03 May 2005 Posts: 72
|
Posted: 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.
|
|
|
|
Stowslee Wanderer
Joined: 20 Apr 2008 Posts: 69 Location: Watervliet, NY
|
Posted: 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. |
|
|
|
teion Wanderer
Joined: 03 May 2005 Posts: 72
|
Posted: 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.
|
|
|
|
|
|