Is there any way to get a value from a database using mmf2? I tried the SQLite3, ODBC and all Moo extensions but i didnt find a way to connect to the database
What i want is some way to get a value form the database and use it inside my application
Typically, you're not allowed to send MySQL commands to send/retrieve data from somewhere that isn't on the same server as the database (I think). As such, you'll need to have a php file on the server to act as a go-between.
Originally Posted by Fifth Hm, I just made a game that does that!
Typically, you're not allowed to send MySQL commands to send/retrieve data from somewhere that isn't on the same server as the database (I think). As such, you'll need to have a php file on the server to act as a go-between.
im not positive as i cant remember if ive ever tried it or not, but i dont think the script HAS to be on the SAME server as the database. When you connect to a mysql database you have to provide it the servername (or ip adress is acceptable i think) that the database(s) is/are hosted on, the user name, and the password. then you mysql_db_select() the database you want to use for sending queries to.
Thanks but i dont think this scoreboard tutorial explains what i need
To be more expecific, I was trying to crate a register/login function for an online game, where the player can register, and then login any time he wants. For that i would use an MySQL database, to store all players names, passwords, scores, characters and stuff
Well, yes, the tutorial is specifically aimed at making an online high score table using php and MySQL, but it pretty much provides an intro to using them in general, in case you don't know how to approach it (as I didn't).
What I was talking about, though, was the line in parentheses in the second paragraph: "(It's possible to communicate directly with some databases from within an MMF application, but the majority of webspace providers don't allow connections to the database from outside the same server.)"
It may be because of such security precautions that you won't just be able to send/retrieve data directly from a MySQL database using your MMF2 program. That's why you'll most likely need a php file or two to do the job.