Game Development Community

MySql connection problem

by CloudFire · in Torque Developer Network · 02/27/2010 (12:15 am) · 1 replies

Hi All

I am using torque 3d demo version. I am trying to connect mysql in remote dedicated server.

when i am trying with the below code

%sql = new Mysql();
%sql.host = "202.191.62.230";
%sql.port = 0;
%sql.user = "user";
%sql.pwd = "pass";

i am receving an following error. Unable to instantiate non class object MySql().

I have one doubt.

is it possible to call c++ functions from torque scripting.

%sql = new Mysql() - is the statement is correct. or torque have some statement equal for that.


please give me an exact statement to work for my code.


thanks and regards

#1
03/01/2010 (1:36 pm)
If you are attempting to connect to the server via ODBC, you will need to have source access to add that functionality. If you are using an intermediary (such as PHP) to access it, then you can send HTTPObjects to your PHP listener and have it parse them and work with your server. You can do this with any listener tech that you create as a bridge.