error 017: undefined symbol "INSERT" > SQL query error
#1

Код:
(3676) : warning 219: local variable "IP" shadows a variable at a preceding level
(3678) : error 035: argument type mismatch (argument 2)
(3679 -- 3682) : error 075: input line too long (after substitutions)
(3683) : error 017: undefined symbol "INSERT"
(3683) : error 017: undefined symbol "INTO"
(3683) : error 017: undefined symbol "playerdata"
(3683) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Код:
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;
}
Can someone give me the fix please?
Reply
#2

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.
Reply
#3

I will change to strcat now.
Reply
#4

Use default values! You're only inserting 14 actual variable values. Default values will tremendously shorten your query.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)