MySQL Help
#1

I started to convert one of my scripts to MySQL and I'm receiving these errors:

pawn Код:
C:\Users\Aaron\Desktop\PGRP\gamemodes\PGRP_mysql.pwn(2545) : error 075: input line too long (after substitutions)
C:\Users\Aaron\Desktop\PGRP\gamemodes\PGRP_mysql.pwn(2546) : error 037: invalid string (possibly non-terminated string)
C:\Users\Aaron\Desktop\PGRP\gamemodes\PGRP_mysql.pwn(2546) : error 017: undefined symbol "UPDATE"
C:\Users\Aaron\Desktop\PGRP\gamemodes\PGRP_mysql.pwn(2546) : error 017: undefined symbol "Accounts"
C:\Users\Aaron\Desktop\PGRP\gamemodes\PGRP_mysql.pwn(2546) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

Here is the Code:

pawn Код:
stock SaveSQLStats(playerid)
{
    new query[1024];
    format(query, sizeof(query), "UPDATE Accounts SET IP=%s Gender=%d, Level=%d, UpgradePoints=%d, ArmorUpgrade=%d, Minutes=%d, TMinutes=%d, Hours=%d, Age=%d, Cash=%d, Bank=%d, Model=%d, Admin=%d, OldAdmin=%d, Mapper=%d, pBanned=%d, Phnumber=%d, AdMute=%d, JackSkill=%d, Death=%d, Dead=%d, Died=%d, Kill=%d, X=%f, Y=%f, Z=%f, Int=%d, Hours=%d, VW=%d, VehVW=%d, WalkStyle=%d, Neon=%d, vNeon=%d, Fac=%d, FacRank=%d, FacLeader=%d, FacDiv=%d, FacDivLeader=%d, Duty=%d, wSlot0=%d, wSlot0Ammo=%d, wSlot1=%d, wSlot1Ammo=%d, wSlot2=%d, wSlot2Ammo=%d, wSlot3=%d, wSlot3Ammo=%d, wSlot4=%d, wSlot4Ammo=%d, wSlot5=%d, wSlot5Ammo=%d, wSlot6=%d, wSlot6Ammo=%d, wSlot7=%d, wSlot7Ammo=%d, wSlot8=%d, wSlot8Ammo=%d, wSlot9=%d, wSlot9Ammo=%d, wSlot10=%d, wSlot10Ammo=%d, wSlot11=%d, wSlot11Ammo=%d, wSlot12=%d, wSlot12Ammo=%d, Hospital=%d, Business=%d, VBusiness=%d, House=%d, Garage=%d, wtSlot1=%d, wtSlot1Ammo=%d, wtSlot2=%d, wtSlot2Ammo=%d, vwtSlot1=%d, vwtSlot1Ammo=%d, vwtSlot2=%d, vwtSlot2Ammo=%d WHERE Username='%s'", //This is the line
Reply
#2

Isn't it improper code?

pawn Код:
stock SaveSQLStats(playerid)
{
    new query[1024];
    format(query, sizeof(query), "UPDATE Accounts SET IP=%s Gender=%d, Level=%d, UpgradePoints=%d, ArmorUpgrade=%d, Minutes=%d, TMinutes=%d, Hours=%d, Age=%d, Cash=%d, Bank=%d, Model=%d, Admin=%d, OldAdmin=%d, Mapper=%d, pBanned=%d, Phnumber=%d, AdMute=%d, JackSkill=%d, Death=%d, Dead=%d, Died=%d, Kill=%d, X=%f, Y=%f, Z=%f, Int=%d, Hours=%d, VW=%d, VehVW=%d, WalkStyle=%d, Neon=%d, vNeon=%d, Fac=%d, FacRank=%d, FacLeader=%d, FacDiv=%d, FacDivLeader=%d, Duty=%d, wSlot0=%d, wSlot0Ammo=%d, wSlot1=%d, wSlot1Ammo=%d, wSlot2=%d, wSlot2Ammo=%d, wSlot3=%d, wSlot3Ammo=%d, wSlot4=%d, wSlot4Ammo=%d, wSlot5=%d, wSlot5Ammo=%d, wSlot6=%d, wSlot6Ammo=%d, wSlot7=%d, wSlot7Ammo=%d, wSlot8=%d, wSlot8Ammo=%d, wSlot9=%d, wSlot9Ammo=%d, wSlot10=%d, wSlot10Ammo=%d, wSlot11=%d, wSlot11Ammo=%d, wSlot12=%d, wSlot12Ammo=%d, Hospital=%d, Business=%d, VBusiness=%d, House=%d, Garage=%d, wtSlot1=%d, wtSlot1Ammo=%d, wtSlot2=%d, wtSlot2Ammo=%d, vwtSlot1=%d, vwtSlot1Ammo=%d, vwtSlot2=%d, vwtSlot2Ammo=%d WHERE Username='%s'",/*your variable's values here*/);
    mysql_query(query);
    return 1;
}
use ' ' in every string specifier. (Ex: '%s')
Reply
#3

The line is too long, if you fix that all errors be gone
Reply
#4

Your line is too long.Split up your code to multiple queries.

And also your query is also wrong.All variable values must be with ' '.
And hence all your string specifiers must be enclosed within ' ' like tiz '%s'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)