Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, Ayumi, PeWi, Quad, VoroneTZ), 513 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
litec-sql dll (mysql for A7) #214631
07/05/08 22:12
07/05/08 22:12
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline OP
Expert
Joozey  Offline OP
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Hello people,

I spent the entire day on making a user friendly mysql connector! This version links to a database on my personal server and practically every query can be performed on it.
Exceptions can be read in the comments in the mysql_test.c.

I recommend not to make use of the database now for development, not that I care but it will be emptied every now and then. Feel free to use some queries on it, it's fully sql-injection sensitive grin. DROP and CREATE DATABASE won't work, and I would prefer you not to use DROP TABLE hiscores. There are other people who want to see what's in it wink.

Download:
litec-sql_0.1.zip


And A6?
I think it works fine for A6 as well, at least for now, if you convert it. If theres much animo for an easy to use c-script version, I'll make one. Vote in the poll.


The commands
There are three commands available:

Code:
int testdb_connect(STRING* username, STRING* password)

Will connect you to the database
returns 1 when succesfull

Code:
STRING* db_query(STRING* query)

Sends a query to the database
returns row(s), column(s) info, or an errormessage.
rows are separated by a comma (,), columns by a colon (:).

Code:
db_close()

Closes the connection

There is a forth, called db_connect and allows to connect to a different database, but this will be available in the future.


The next step
This said, I have another plan for you beloved 3dgs forumusers. If this is running well, I will open a register page for people to create their own personal test database. Give your username and password in the registration form, fill them in in your testdb_connect() function, and you're set!

I do like to know if you think this (and other features) will come in handy,so please take ten seconds to fill in the poll below.

Regards,

Joozey



The Poll
[redirect link to poll, can't make polls in user contributions]


The screens




--



Last edited by Joozey; 07/05/08 22:20.

Click and join the 3dgs irc community!
Room: #3dgs
Re: litec-sql dll (mysql for A7) [Re: Joozey] #214655
07/06/08 07:26
07/06/08 07:26
Joined: Apr 2005
Posts: 3,815
Finland
Inestical Offline
Rabbit Developer
Inestical  Offline
Rabbit Developer

Joined: Apr 2005
Posts: 3,815
Finland
Here's some things I would add or change to make it more better smile

  • Database connection would return connection variable.
  • db_query should be altered to db_query(string* query, int connection)
  • db_close should be altered to db_close(int connection);
  • This allows multiple connections to be used (useful in some places).
  • make db_connect(string* server, string* username, string* password); and db_select_database(string* database, int connection); or mix these, even though keeping these two separate does make it more agile (no need for new connection when hot switching databases)
  • add useful functions such as db_num_rows, db_list_tables, etc.



"Yesterday was once today's tomorrow."
Re: litec-sql dll (mysql for A7) [Re: Inestical] #214661
07/06/08 09:11
07/06/08 09:11
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Polls aside, you know I am 100% behind any A7-MySQL initiative, bro!!
Keep the DB dream alive!

Re: litec-sql dll (mysql for A7) [Re: fastlane69] #214706
07/06/08 17:41
07/06/08 17:41
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline OP
Expert
Joozey  Offline OP
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Quote:
This allows multiple connections to be used (useful in some places).
Yes, noted.

Quote:
add useful functions such as db_num_rows, db_list_tables, etc.
I could, but you could do too within a query. I don't see how this helps improving the DLL other than doing the SQL for you smile.

Quote:
Polls aside, you know I am 100% behind any A7-MySQL initiative, bro!!
You... don't like polls? smile


Click and join the 3dgs irc community!
Room: #3dgs
Re: litec-sql dll (mysql for A7) [Re: Joozey] #215472
07/11/08 12:40
07/11/08 12:40
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
I'd like to see an implementaton similar to MySQL for PHP regarding function names, parameters, return values...

Apart from that: fine job smile

Re: litec-sql dll (mysql for A7) [Re: FBL] #219389
08/02/08 13:47
08/02/08 13:47
Joined: May 2008
Posts: 91
Eugene, OR. USA
ATOMIX Offline
Junior Member
ATOMIX  Offline
Junior Member

Joined: May 2008
Posts: 91
Eugene, OR. USA
Joozy I love your contribution and you will save a lot of people a lot of work. I don't mean to give anyone a hard time but as an System Admin and serious C/C++ developer for over 25 years I have had to read a lot of licenses. We also have a patent/technical attorney to help us with the stuff we don't understand. MySQL is not interested in Game Development, and their license for using the dll in your own distributable program was over $10,000.00 USD the last time we checked. It is only free to web hosters and not to software developers. We were very sorry to learn this ourselves as we had developed an entire system online of MySQL databases and could not use them even on our local network. We were forced to move to SQLite because of the license restrictions from MySQL. Remember they are a for-profit company and have to sell something to keep developing. They sell seminars, support and licenses. For us small time developers the cost was prohibitive, plus we have to make sure that we can deliver all parts of our software legally and without restraint.


ATOMIX Productions
ATOMIX Group LLC
http://theatomizer.com
A7 Pro 7.50
Re: litec-sql dll (mysql for A7) [Re: ATOMIX] #219443
08/02/08 16:27
08/02/08 16:27
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Nice work, this is a great LC based code for MySQL connectivity/compatibility towards A7 smile smile

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: litec-sql dll (mysql for A7) [Re: Joozey] #219459
08/02/08 17:41
08/02/08 17:41
Joined: May 2008
Posts: 91
Eugene, OR. USA
ATOMIX Offline
Junior Member
ATOMIX  Offline
Junior Member

Joined: May 2008
Posts: 91
Eugene, OR. USA
How do we connect to a database?? blush


ATOMIX Productions
ATOMIX Group LLC
http://theatomizer.com
A7 Pro 7.50
Re: litec-sql dll (mysql for A7) [Re: ATOMIX] #219470
08/02/08 18:21
08/02/08 18:21
Joined: May 2008
Posts: 301
Oxy Offline
Senior Member
Oxy  Offline
Senior Member

Joined: May 2008
Posts: 301
can this connect to a database over the net?
How to configure the environment for that?

Re: litec-sql dll (mysql for A7) [Re: Oxy] #219473
08/02/08 18:28
08/02/08 18:28
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
When applying for a data base, you need to set up a private server (password based to say it easy) via MySQL, connect the in and output via php (query based), send that data over a dll which Joozey already made for you (thank you again ^^) and use the corresponding dll functions in your script via SED (A7) wink wink

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Page 1 of 4 1 2 3 4

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1