About Mysql
#3

1) Splitting.
pawn Код:
format(Query2,sizeof(Query2),
"INSERT INTO ...",
PN(playerid), string, ...);
2) strcat
pawn Код:
Query = "INSERT INTO `Users` (`Name`, ...)";
strcat(Query, " VALUES ('%s', ...)");

format(Query, sizeof(Query), Query, PN(playerid), string, ...);
3) Zeex's compiler exceeds the line limit to 4095 characters:
https://github.com/Zeex/pawn
https://sampforum.blast.hk/showthread.php?pid=2768123#pid2768123

---

Notes:
- Consider updating to the latest versions of mysql plugin.
- Escape strings when needed.
- Use default values to reduce the query.
- Values' specifiers (only strings) need an apostrophe and not grave accent character. It will result in error in syntax.
Reply


Messages In This Thread
About Mysql - by StrikerZ - 07.11.2016, 09:05
Re: About Mysql - by StrikerZ - 07.11.2016, 09:25
Re: About Mysql - by Konstantinos - 07.11.2016, 10:06
Re: About Mysql - by zPain - 07.11.2016, 10:09
Re: About Mysql - by StrikerZ - 07.11.2016, 11:50
Re: About Mysql - by Konstantinos - 07.11.2016, 11:56
Re: About Mysql - by StrikerZ - 07.11.2016, 12:03
Re: About Mysql - by Konstantinos - 07.11.2016, 12:05
Re: About Mysql - by StrikerZ - 07.11.2016, 12:19
Re: About Mysql - by StrikerZ - 07.11.2016, 12:39

Forum Jump:


Users browsing this thread: 1 Guest(s)