Game Development Community

problem appears in connection with mySQL

by Dimitris Matsouliadis · in Torque 3D Professional · 08/31/2010 (9:04 pm) · 3 replies

if can anyone help ... thanks

from %id to %level everything is OK. from %team to %datablock in the t3d i got the following error:
mySQL: unknown field name: team ... sex, datablock

i have this error in all tables and not stable in cells


%mysql.Query ("SELECT * FROM npc");
%result= %mysql.StoreResult();

for (%i= 0; %i< %mysql.NumRows (%result); %i++)
{
%mysql.FetchRow (%result);
%id = %mysql.GetRowCell (%result, "id");
%idTemplate = %mysql.GetRowCell (%result, "idTemplate");
%name = %mysql.GetRowCell (%result, "name");
%class = %mysql.GetRowCell (%result, "class");
%level = %mysql.GetRowCell (%result, "level");
%team = %mysql.GetRowCell (%result, "team");
%sex = %mysql.GetRowCell (%result, "sex");
%datablock = %mysql.GetRowCell (%result, "datablock");

echo ("SQL result=" SPC %id SPC %idTemplate SPC %name SPC %class SPC %level SPC %datablock );

}

#1
08/31/2010 (11:29 pm)
Your bug is that you are making SQL queries from the client. Fix that bug first.
#2
09/01/2010 (1:25 pm)
this querie is not from client side.... is from server side in scripts/server/AIloader.
working in a system of mmo and try to change the ascii files database to mySQL database. For the time all is ok outside this prob.

And why querie answer me but know the only half fields of row?

thanks for answer :)
#3
09/03/2010 (10:02 pm)
the answer is on GetRowCell. If any use mySQL with up to 20 fields in a row the better choice is the GetRowCellDirect mysql command.
only need to change the name of field with the proportionate number like this:
%datablock = $mysql.GetRowCellDirect (%result, 8);