SA-MP Forums Archive
saving with loop mysql +Rep - 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)
+--- Thread: saving with loop mysql +Rep (/showthread.php?tid=571372)



saving with loop mysql +Rep - iBots - 18.04.2015

how is it possible to save something in a file using a loop,instead of putting them all i wanna put like item1 = pinfo[playerid][pitem][0],like this..


Re: saving with loop mysql +Rep - Azula - 18.04.2015

PHP код:
For(new i=0;!=MAX_PLAYERS -1;i++)
{
      
item[i+1][playerid] =   pinfo[playerid][pitem][i+1];

PHP код:
new item[MAX_item][MAX_PLAYERS]; 



Re: saving with loop mysql +Rep - iBots - 18.04.2015

i meant inserting them to the table


Re: saving with loop mysql +Rep - Azula - 18.04.2015

PHP код:
new dbHandle,query;
    
mysql_format(dbHandlequerysizeof(query), "UPDATE `Users` SET `item`='%i',pinfo[playerid][pitem][i+1]);
mysql_tquery(dbHandle, query, "", ""); 
change Users by your db table name and make sur you have item table created


Re: saving with loop mysql +Rep - iBots - 18.04.2015

i said 'insert' not 'update',come on.


Re: saving with loop mysql +Rep - iBots - 18.04.2015

Anyone?