saving in one query.
#1

Hi,

It's possible to update mysql table with one query? because now i have a lot of things i need to update, that's why i use about 5 mysql_query. Because if i wrote all in one line i get input line too long bla bla.. But maybe possible to write it?
Reply
#2

Quote:
Originally Posted by audriuxxx
Посмотреть сообщение
Hi,

It's possible to update mysql table with one query? because now i have a lot of things i need to update, that's why i use about 5 mysql_query. Because if i wrote all in one line i get input line too long bla bla.. But maybe possible to write it?
When you go to enter the variables, press return to go to a new line and finish typing there, then you wont get the input line too long
Reply
#3

no no i have write no variables just that what i will save i get input line too long.
Reply
#4

You could use '\' to skip to the next line, preventing that input line too long error.

Example:
pawn Код:
format(string, sizeof string, "\
%s test1"
,\
var\
);
Also Strcat can be used to join strings together.
Reply
#5

Use format.

pawn Код:
new string[...];
format(string,sizeof(string),"UPDATE `accounts` SET `x` = 'y', SET `x` =");
format(string,sizeof(string),"%s 'z'",string);
Reply
#6

Quote:
Originally Posted by xXShadowXx
Посмотреть сообщение
Use format.

pawn Код:
new string[...];
format(string,sizeof(string),"UPDATE `accounts` SET `x` = 'y', SET `x` =");
format(string,sizeof(string),"%s 'z'",string);
strcat is faster.
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
strcat is faster.
Also rather awkward when arguments are needed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)