[Help-SQL] I need help to select data
#1

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?
Reply
#2

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

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
Reply
#4

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)