SQL Problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SQL Problem (
/showthread.php?tid=135753)
SQL Problem -
Tom_Dedi - 21.03.2010
Hello Guys,
I have a problem with the MYSQL-Plugin with Pawno the PAWN editor I can't write unlimited lines
but the MYSQL system needs it how I can it make other
here:
Код:
new mystr[256];
format (mystr,sizeof(mystr),
"Name='%s',Admin='%d',Kills='%d',Deaths='%d',Logins='%d',Freischaltung='%d',X='%f',Y='%f',Z='%f',CX='%f',CY='%f',CZ='%f',HX='%f',HY='%f',HZ='%f',Crashed='%d',Skin='%d',Polizist='%d',PolizeiSkin='%d',ADAC='%d',ADACSkin='%d'",
tname,
tadmin,
tkills,
tdeaths,
tlogins,
tfrei,
tx,
ty,
tz,
tcx,
tcy,
tcz,
thx,
thy,
thz,
tcrash,
tskin,
tpolizei,
tpolizeiskin,
tadac,
tadacskin);
if (!InsertMySQL("tabelle",mystr)) {printf("Daten konnten nicht eingefьgt werden!");}
I want it so:
Код:
new mystr[256];
format (mystr,sizeof(mystr),"Name='%s'",PlayerName(playerid));
if (!InsertMySQL("tabelle",mystr)) {printf("Daten konnten nicht eingefьgt werden!");}
format (mystr,sizeof(mystr),"Admin='%d'",Account[playerid][Admin]);
if (!InsertMySQL("tabelle",mystr)) {printf("Daten konnten nicht eingefьgt werden!");}
I use this Plugin und this Include
http://www.downloads.realoa.de/Sonst...eandPlugin.rar
-Dedi
Re: SQL Problem -
Tom_Dedi - 22.03.2010
No one can help me??
Re: SQL Problem -
[HiC]TheKiller - 22.03.2010
If you are talking about a problem with the length, split it into multiple strings then put it into a string at the end.
E.g.
pawn Код:
new str[25][3], endstr[85];
format(str[0], 25, "Hi, how are you today?");
format(str[1], 25, "Good, how about you?");
format(str[2], 25, "Very well thank you.");
format(endstr, 85, "%s %s %s", str[0], str[1], str[2]);
Re: SQL Problem -
Tom_Dedi - 22.03.2010
Its a good idea but if I have str1,str2,str3...str999 than I have the problem with to long lines again