Help - Search - Members - Calendar
Full Version: Mysql
Game Maker Community > Working with Game Maker > Advanced Users Only
chagy
is it possible to make a DLL and connect to mySQL from Game Maker?
i dont think it would be possible to connect mySQL directly with scripting in gm...



edit: ops wrong board sad.gif
Haxor
Yes it is very possible with a tool called MySQL++. And programming for MySQL in C++ is also very easy. The only problem is, as far as I can tell, you must buy a license to distribute a DLL using MySQL++, which costs a lot of money. I'm not sure, since their statement is a little ambiguous and they never emailed me back when I asked them about it.
chagy
hmm then its possible to connect mySQL from gm like java huh
but java has its own mysql-connector plug-in ...
well i think i could make a DLL for it if i had delphi...

so i guess nothing is impossible except skating thru revolving door tongue.gif
EricDB
I did a little bit of web reading on this. There is a DLL distributed with MySQL called libmysql.dll, that allows you full access to the API. The only problem with using it in GM is that it expects a lot of structs and other datatypes that GM doesn't support directly.

There is also a Delphi interface to libmysql.dll that might be a good area to check out. Using Delphi and this wrapper, it may be possible to expose some functions to GM that wouldn't require complex data types.

To Haxor: I wouldn't worry too much about licensing issues with dll distribution. Is your game going to require that they download and install MySQL in order to play? I think something like this would be more suited to a dedicated server than distribution to end users.

Edit: Oh, I forgot you can connect to a MySQL server over the internet. Never mind.
Shadow of the Moon
PHP scripts can access a MySQL database, and Game Maker can run scripts on webservers with the execute_shell() function. Just install the scripts on the server and call them from your game. No DLL nescesarry.

Reading would be a little more difficult, but doable.
GreenDragon
If they are goin to have to download MySQL then you can just use the command line MySQL program since it returns values and GM can handle that.
Haxor
QUOTE
PHP scripts can access a MySQL database, and Game Maker can run scripts on webservers with the execute_shell() function. Just install the scripts on the server and call them from your game. No DLL nescesarry.

Reading would be a little more difficult, but doable.


This is, however, very insecure and practically opens your database to anyone who wants to mess with it.
Shadow of the Moon
QUOTE (Haxor @ Nov 19 2003, 05:46 PM)
QUOTE
PHP scripts can access a MySQL database, and Game Maker can run scripts on webservers with the execute_shell() function. Just install the scripts on the server and call them from your game. No DLL nescesarry.

Reading would be a little more difficult, but doable.


This is, however, very insecure and practically opens your database to anyone who wants to mess with it.

How is it any different than a web page that uses PHP scripts?
Richard
Does a web page using PHP scripts to work with a MySQL database usually provide an easily accessible URL via which anyone can have the script update the database? Your game would have to pass the script some information for adding to/editing/removing from the database, and anyone could easily pass their own information.

That's assuming the game wasn't passing the script the username and password. If it was, it'd obviously be even more insecure.


Richard
Haxor
And I'd add .. it's relatively simple to find what page your game is accessing. execute_shell() opens a new IE window. DT's browser embedding DLL would be a more secure method, but again simple to find out through I.E.'s history or with a packet sniffer.
Kristoffer
QUOTE (chagy @ Nov 18 2003, 11:05 PM)
well i  think i could make a DLL for it if i had delphi...

I think you can get Delphi Personal Edition for free if you search the web.
You can also get it in computer magazines.
neonsoulstealer
You don't need a DLL. MySQL tables and libraries are largely based on Perl, so I would learn Perl before going foward.

EDIT: Wait, what do want MySQL for anyway?
Brocky
Smarty has a dll for connecting to a mySQL database
http://forums.gamemaker.nl/lofiversion/index.php/t33363.html

i think there is a newer version of this somewhere in the 'Extending Game Maker: DLLs, Scripts, and Libraries' section.
39ster
QUOTE (Brocky @ Apr 12 2006, 04:47 PM)
Smarty has a dll for connecting to a mySQL database
http://forums.gamemaker.nl/lofiversion/index.php/t33363.html

i think there is a newer version of this somewhere in the 'Extending Game Maker: DLLs, Scripts, and Libraries' section.
*

What the hell? This topic is over 2 years old? Why would you do that?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.