03.04.2016, 00:13
hi, I want to ask for help in the following function.
Basically I want his method of using it:
GuardarCampo (ID, Table, Field1, Value1, Field2, Value2, etc ..);
I have the following code:
But I have a problem and I print it this way:
It donot really a lot of use of the endless arguments (...)
Basically I want his method of using it:
GuardarCampo (ID, Table, Field1, Value1, Field2, Value2, etc ..);
I have the following code:
PHP код:
stock GuardarCampostr(id,Tabla[], ...)
{
new Args = 2;
new query[256];
new inf_Salida[256];
format(inf_Salida,sizeof(inf_Salida),"UPDATE `%s` SET ",Tabla);
do
{
format(query,sizeof(query),"`%s`=%s,",getarg(Args-1), getarg(Args));
Args+=2;
strcat(inf_Salida,query);
}
while(Args <= numargs()-1);
format(query,sizeof(query),"`%s`=%s WHERE `ID`=%d",getarg(Args-1), getarg(Args),id);
strcat(inf_Salida,query);
printf(inf_Salida);
}
pawn Код:
UPDATE `svr_cuentas` SET `s`=Ms,``=M,``=M,``= WHERE `ID`=1