06.03.2016, 13:37
Hi i have problem... Please help me and sorry for english
I have bank system with transaction history , loading and save in database,one transaction = one string..
Have this
Save new string to database field "Transaction"... One string = one rows in field "Transaction"
new Query[200];
format(Query,sizeof(Query), "UPDATE `transactionbank` SET `Transaction` = concat(`Transaction`,'\nSome words') WHERE `Username` ='%s' LIMIT 1",Name(playerid));
mysql_query(Query);
Example in database
Transaction
--------------
string1
string2
This work is ok, but problem in loading
new Transaction[MAX_PLAYERS_EX][500];
Field ґTransactionґ in database set on VARCHAR(500)
if(listitem == 4)
{
new Query[500],string1[500];
format(Query, sizeof(Query), "SELECT `Transaction` FROM `transactionbank` WHERE `Username` ='%s' LIMIT 1", Name(playerid));
mysql_query(Query);
mysql_store_result();
new rows = mysql_num_rows();
if(rows == 1)
{
mysql_fetch_row_format(Query,"|");
sscanf(Query,"p<|> s[500]",Transaction[playerid]);
format(string1,sizeof(string1),"%s",Transaction[playerid]);
ShowPlayerDialog(playerid,D_BankTransaction,DIALOG _STYLE_LIST,"{61B1FF}Last Transaction",string1,"Ok","");
}
mysql_free_result();
}
Problem is...
Database "Transaction"
---------------------------
Some word
Loading ok but...
"Transaction"
----------------
Some word
Some word
Loading to dialog "Some" it is all... I use sscanf,mysql_fetch_field_row... But the problem persists... Why
I want to load the first 15 transactions in dialog
Thx for help and sorry this is my first posts,i can not use code window
I have bank system with transaction history , loading and save in database,one transaction = one string..
Have this
Save new string to database field "Transaction"... One string = one rows in field "Transaction"
new Query[200];
format(Query,sizeof(Query), "UPDATE `transactionbank` SET `Transaction` = concat(`Transaction`,'\nSome words') WHERE `Username` ='%s' LIMIT 1",Name(playerid));
mysql_query(Query);
Example in database
Transaction
--------------
string1
string2
This work is ok, but problem in loading
new Transaction[MAX_PLAYERS_EX][500];
Field ґTransactionґ in database set on VARCHAR(500)
if(listitem == 4)
{
new Query[500],string1[500];
format(Query, sizeof(Query), "SELECT `Transaction` FROM `transactionbank` WHERE `Username` ='%s' LIMIT 1", Name(playerid));
mysql_query(Query);
mysql_store_result();
new rows = mysql_num_rows();
if(rows == 1)
{
mysql_fetch_row_format(Query,"|");
sscanf(Query,"p<|> s[500]",Transaction[playerid]);
format(string1,sizeof(string1),"%s",Transaction[playerid]);
ShowPlayerDialog(playerid,D_BankTransaction,DIALOG _STYLE_LIST,"{61B1FF}Last Transaction",string1,"Ok","");
}
mysql_free_result();
}
Problem is...
Database "Transaction"
---------------------------
Some word
Loading ok but...
"Transaction"
----------------
Some word
Some word
Loading to dialog "Some" it is all... I use sscanf,mysql_fetch_field_row... But the problem persists... Why
I want to load the first 15 transactions in dialog
Thx for help and sorry this is my first posts,i can not use code window