Game Development Community

Databasing throught Torque

by Spencer Simonsen · in Technical Issues · 02/08/2007 (6:50 pm) · 6 replies

Does anyone know how to connent to a mysql database on a website in order to upload new accounts from a game or to check account for a game? and will this need engine edits? This is for TGE 1.5.

#1
02/08/2007 (6:54 pm)
There IS a SQL resource, but if you aren't for programming, you can do what I did and connect to a php page that connects to a sql server, then write and pull data from there.

If you do this, make sure you secure all of your data.
#2
02/08/2007 (7:54 pm)
Ok, i got the writing to the database part, by connecting through a php page, but i'm not sure how to pull data from the database and send it into TGE. Also, does the engine need to be edited to do these things, i seem to remember editing in 1.4 but is it needed in 1.5?
#3
02/09/2007 (6:30 am)
@Spencer, Torque does not provide database support "out of the box" ... you can use a C++ resource to add this functionality, or you can use Maxwell's method by "faking" it --

If your curious about how to use Maxwell's method, look up my recent .plans -- I recently posted an "httpPage" torquescript class that allows you to retrieve web-page results ... and you can pass the page data using the querystring.
#5
02/09/2007 (2:02 pm)
Thanks for all your help guys, i'll try to implement these features in my game, if you have any other links or resources you feel could help me, please post them.
#6
02/10/2007 (5:28 pm)
@Spencer, if you look at the recent resources I've posted -- one of them is an XMLObject that allows you to 'sax' parse XML fragments (or documents) -- this could be useful for transferring data back and forth from the web server to the game client in an 'agnostic' manner (ie; rather then sending TorqueScript back to be eval()'d or "INI Style" var=val strings -- you could allow for additional programs to easily hook into your scripts and expose the DTD for the documents for these programs to adhere to -- )