ID:156922
 
I'm currently trying to use world.Export() to make a savefile system that wouldn't be serverside hosted. (And not clientside either...)

So, i'm curious as to how it can be done, making a PHP script that can pick up what's being sent by Export, and then fetch the needed data from the MySQL database.

Any ideas guys?
Is there any reason you wouldn't want to use 'Byond >> mySQL' over 'Byond >> PHP >> mySQL' ?
In response to Pirion
So he doesn't have to put passwords in a byond resource?
In order to do that, do not use Export. You need to do it with browse and open the PHP page on your server that has the save code. You would make the link something like:
http://www.whatever.com/ savefile.php?icon=[icon]&hp=[hp]&mp=[mp] etc.
Now, in the PHP file you would use $_GET to get those values out of the URL and put them into the database. Good luck sir.
In response to JoEn00b
Using a $_GET with a URL is alot more insecure, do you not think?

Also, the Username/Password if put into the code will be in the DMB, not the RSC, although there are a few other ways to store the username/password that would not put them in the DMB.
In response to Pirion
No, not really because you're not storing any passwords for anything in the $_GET variables. You can also encrypt the entire script so that even if someone did hack the website, they would still have to decrypt the scripts, and I can't imagine someone wanting to cheat in a game THAT badly. Although, I don't put anything past cheaters these days.
In response to JoEn00b
Please use you head.

Using the script, with a $_GET 'REMOVES' the need for anyone to use the password.
Noone would need to see the script if they just grab the byond browsers URL. (Infact even my router grabs every browser page loaded.)

Also, if the PHP script is not setup correctly leaves the database open to mySQL injection attacks.
In response to Pirion
Any person that can use google can avoid sql injections.
You're much better off interacting directly with the MySQL database rather than going through a PHP medium.

BYOND supports direct interaction with MySQL databases via hub://dantom.db.
Nadrew discusses this here: http://www.byond.com/members/ DreamMakers?command=view_post&post=79592
In response to Murrawhip
Murrawhip wrote:
You're much better off interacting directly with the MySQL database rather than going through a PHP medium.

BYOND supports direct interaction with MySQL databases via hub://dantom.db.
Nadrew discusses this here: http://www.byond.com/members/ DreamMakers?command=view_post&post=79592

Maybe so, but that post doesn't speak of anything that the db server requires to have to make it work.

Besides, that library isn't exactly programmer friendly in my eyes. But that's just me.
In response to Capalex65
If you're able to connect to the database externally using PHP you can use the DB library to connect to it the same way. Some hosts do prevent remote access to MySQL, however. You'd have to check with your host.

The library isn't really supposed to be user friendly as it's simply a hook to some internal DM functions and isn't meant to be dissected unless you know what you're doing.
In response to Nadrew
Nadrew wrote:
If you're able to connect to the database externally using PHP you can use the DB library to connect to it the same way. Some hosts do prevent remote access to MySQL, however. You'd have to check with your host.

The library isn't really supposed to be user friendly as it's simply a hook to some internal DM functions and isn't meant to be dissected unless you know what you're doing.

I get an error saying "The specified module wasn't found" any idea as to which module that'd be?
In response to Pirion
Pirion wrote:
Is there any reason you wouldn't want to use 'Byond >> mySQL' over 'Byond >> PHP >> mySQL' ?

It is a matter of preference, but going BYOND MySQL would be the more practical approach.

Capalex65 doesn't find the library easy to learn, but in my opinion, it is not that hard especially for someone who I assume knows PHP & MySQL. It would take that long to learn the library.

http://www.byond.com/members/ DreamMakers?command=view_post&post=79592
In response to Samehada24
Hey now. I know PHP and MySQL. It's just the BYOND coding involved in the library i find odd compared to what i'm used to.
In response to Capalex65
You must have libmysql.dll in your windows/system folder to correct your problem.
You should be able to google it pretty easily.
In response to Murrawhip
I'm not the one hosting neither the game, nor the mysql folder. As as far as i remember, my web provider is running on a debian system.
In response to Capalex65
Who ever is hosting the game needs that DLL if they are hosting on windows.

I believe somewhere it said it can be packaged with the game files but I am unable to locate the post.
In response to Capalex65
Who installed BYOND on the Debian system?

You could ask them to install mysql-client libs for you.
In response to Pirion

You do need to include the 'libmysql.dll' to the games folder. Tried it, works perfectly fine.

http://www.byond.com/members/ DMCGI?command=view_post&post=31526
In response to Murrawhip
It isn't.