SA-MP Forums Archive
[Help-SQL] I need help to select data - 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: [Help-SQL] I need help to select data (/showthread.php?tid=286345)



[Help-SQL] I need help to select data - InsaniManES - 28.09.2011

I need help to select data.
For example:
I have a database like that (In phpmyadmin not pawn):
Nick[25]
Pass[20]
Money - int
And in pawn i have the var:
new details[3];

What should I do to put the data in the var?


Re: [Help-SQL] I need help to select data - [MWR]Blood - 28.09.2011

http://forum.sa-mp.com/showthread.ph...g+mysql+system


Re: [Help-SQL] I need help to select data - Retardedwolf - 28.09.2011

Spoonfed


Quote:
Originally Posted by iggy1
Посмотреть сообщение
pawn Код:
new szQuery[264];
format(szQuery, sizeof(szQuery), "SELECT Nick, Pass, Money FROM table_name WHERE something='%s'", some_value);
mysql_query(szQuery);
mysql_store_result();
mysql_fetch_row_format(szQuery, "|");
mysql_free_result();
   
new
    iMoney,
    szDetails[2][26];
sscanf(szQuery, "p<|>s[25]s[20]i", szDetails[0], szDetails[1], iMoney);//or use explode



Re: [Help-SQL] I need help to select data - InsaniManES - 28.09.2011

I knew how to do it.
I used the function Explode. Can you tell me how to do it?


Re: [Help-SQL] I need help to select data - Vince - 28.09.2011

Wont work. If you want to use an array for different datatypes (strings and integers) you need an enum or two different arrays.


Re: [Help-SQL] I need help to select data - iggy1 - 28.09.2011

pawn Код:
new szQuery[264];
format(szQuery, sizeof(szQuery), "SELECT Nick, Pass, Money FROM table_name WHERE something='%s'", some_value);
mysql_query(szQuery);
mysql_store_result();
mysql_fetch_row_format(szQuery, "|");
mysql_free_result();
   
new
    iMoney,
    szDetails[2][26];
sscanf(szQuery, "p<|>s[25]s[20]i", szDetails[0], szDetails[1], iMoney);//or use explode