Код:
stock MySQL_Register(playerid, passwordstring[])
{
new query[MAX_STRING], pname[24];
GetPlayerName(playerid, pname, 24);
GetPlayerIp(playerid, IP, 15);
format(query, sizeof(query),
"INSERT INTO playerdata (user, bank, playerlvl, rpoints, playertime, jail, jailreason, jailtime, banned, banreason, whobannedme, \
whenigotbannedm Skin, ranklvl, rentprice,driverlic, flylic, boatlic, weplic, jobtime, jobskill, totalpayt, totalrefuel, kills, deaths, \
housenum, loan, drugs, sdrugs, nreports, power, spawnX, spawnY, spawnZ, spawnZ, spawnInter, factnumber, head, headby, famnumber, female, \
bail, premium, gotphone, phonenumber, phonebook, laptop, virworld, age, premiumexpire, playerteam, playerBarrierKeys, radio, freq1, freq2,\
freq3, tutorial, tbanned, city, married, family, faction, PTeamName, job, totalrules, fpay, warns, helper, curfreq, rankname, pdspawn, \
phonechanges, lastonline) VALUES ('%s', 0, 1, 0, 0, 0, ('%s', 0, 0, ('%s', ('%s', ('%s', Skin, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, ('%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ('%s', ('%s', ('%s', ('%s', ('%s',\
('%s', 0, 0, )", pname, passwordstring, jailreason, banreason, whobannedme, whenigotbanned, headby, city, married, family, faction, \
PTeamName, job, rankname);
// Scruffy!!!!!!!
//===========================================
mysql_query(query);
format(iStr, sizeof(iStr), "3[ REGISTER ] %s[%d] has registered.", PlayerName(playerid), playerid);
iEcho(iStr);
printf("%s's account created.",PlayerName(playerid));
return 1;
}
you're Query needs to be formatted in one line unlike in PHP. you can't split it up like that or the compiler reads it as a new line with no parenthesis.
at least thats what I think. I had the same issue a while back and had to work out a shorter query due to the line length limit in pwn. I ended up using strcat to create the query.
Use default values! You're only inserting 14 actual variable values. Default values will tremendously shorten your query.