get_xp_from_file()
Posted: Fri Aug 12, 2005 4:05 pm
You should change the SELECT * FROM table, into actually telling what fields you want. It will lift a bit of load of the SQL-server.
and also these so they reflect the change above
same thing later in that code
and also changing the dbi_field() so it reflects the changes made
Code: Select all
#if MYSQL_ENABLED
if (returnrace)
{
if (get_cvar_num("mp_savebyname")==1)
format(mquery, 1023, "SELECT xp, race FROM `%s` WHERE playername='%s'",mysqltablename,playername)
else
format(mquery, 1023, "SELECT xp, race FROM `%s` WHERE playerid='%s'",mysqltablename,playerid)
Code: Select all
dbi_field(res,1,xp,7)
dbi_field(res,2,race,1)
Code: Select all
if (get_cvar_num("mp_savebyname")==1)
format(mquery, 1023, "SELECT xp, skill1, skill2, skill3, skill4 FROM `%s` WHERE playername='%s' AND race='%d'",mysqltablename,playername,p_skills[id][0])
else
format(mquery, 1023, "SELECT xp, skill1, skill2, skill3, skill4 FROM `%s` WHERE playerid='%s' AND race='%d'",mysqltablename,playerid,p_skills[id][0])