Quote:
Originally Posted by blackops7799
|
1. make sure you have a 'users' table with fields 'level', 'xp', 'JobID' in existence:
Code:
format(query,255, "SELECT level,xp,JobID FROM users WHERE steamid='%s'", authid);
2.
Code:
#
level[id] = dbi_field(result,1);
#
xp[id] = dbi_field(result,2);
#
JobID3[id] = dbi_field(result,3);
#
indatabase = 1;
if you don't have those arrays (level, xp, JobID3) declared, you will be screwed.
3.
Code:
#
format(query,255,"INSERT INTO users (steamid,level,xp) VALUES('%s', '1', '0')",authid);
#
format(query,255,"INSERT INTO money (steamid,money) VALUES('%s', '500')",authid)
#
format(query,255,"INSERT INTO powerup (steamid,regen,vampire,armor,ammoregen) VALUES('%s', '0', '0', '0', '0')",authid)
#
dbi_query(dbc,"%s",query);
from the extensive work I've done with small and SQL, it seems that
Code:
format(query,255,"INSERT INTO powerup (steamid,regen,vampire,armor,ammoregen) VALUES('%s', '0', '0', '0', '0')",authid)
will be the ONLY code allocated to "query," multiple queries requires a little more work.
I don't see this code working correctly but maybe there is something I'm not seeing - drop me a line or re-post here and maybe you can clarify more for me.
From reading this code, my conclusion is that you are telling the computer the user is NOT in the database
, then you get their info. then check the SQL database for their info., then if they DON'T exist, I guess it adds them. A description for what this SHOULD do would be helpful.
Also, make sure your database actually exists and the computer is connecting to it. (Check your logs and/or add debug messages to your code).
Slmclarengt
__________________