Amiga.org

The "Not Quite Amiga but still computer related category" => Alternative Operating Systems => Topic started by: TheMagicM on January 31, 2005, 12:25:38 AM

Title: Accessing a DB through C..accomplished..
Post by: TheMagicM on January 31, 2005, 12:25:38 AM
..somewhat.. same concept...

I tried SQLite3 on my linux box..its basically creating a database as a single file..yet it supports a variety of SQL commands..indexes etc.. so I created a silly db just to see if it works..so I modified a example code that opens a the sqlite database, runs a command against it and brings back the result..

SQLite:
http://www.sqlite.org

sample output..

themagicm@linux:~/workspace/test> ./test testdb.db
Usage: ./test DATABASE SQL-STATEMENT
themagicm@linux:~/workspace/test> ./test testdb.db "select * from test;"
name = SideWinder
disk_num = 1
comment = rox
type = G
themagicm@linux:~/workspace/test>

I tried MySQL but am having problems setting it up so I looked around and found this as a good replacement. I'll setup a real db and run some speed tests on it to see how it works under load.
the above url has sample C code that does the above..I used their example and put it in my code to accomplish the above.  (not difficult..pull stuff from example..paste in code..modify to suit needs. LOL)



-Alex
Title: Re: Accessing a DB through C..accomplished..
Post by: Karlos on January 31, 2005, 12:51:48 PM
You should just make a web based front end and use php/mysql. It's a doddle :-D
Title: Re: Accessing a DB through C..accomplished..
Post by: TheMagicM on January 31, 2005, 02:23:16 PM
yea I know.. since I cant get it working properly (MySQL)..I wanted to try this out to see how it works..