MySQL select a whole row
#3

Quote:
Originally Posted by Mandrakke
Посмотреть сообщение
pawn Код:
new Query[299]; // On the top
new temp[50];   // Inside OnPlayerCommandText
new Code[30];   // Inside OnPlayerCommandText
new ID;         // Inside OnPlayerCommandText
new Amount;     // Inside OnPlayerCommandText

// The code below should be in the command '/redeem' condition
format(Query, sizeof(Query), "SELECT * FROM table_name_change_here WHERE Code = '%s' LIMIT 0,1", code);
mysql_query(Query);
mysql_store_result();

if(mysql_retrieve_row()) {
    mysql_fetch_field_row(temp, "Code");    format(Code, sizeof(Code), "%s", temp);
    mysql_fetch_field_row(temp, "ID");      ID      = strval(temp);
    mysql_fetch_field_row(temp, "Amount");  Amount  = strval(temp);
}

mysql_free_result();
Thanks!
Reply


Messages In This Thread
MySQL select a whole row - by Jeroen52 - 21.05.2012, 19:06
Re: MySQL select a whole row - by Mandrakke - 22.05.2012, 14:32
Re: MySQL select a whole row - by Jeroen52 - 22.05.2012, 15:11

Forum Jump:


Users browsing this thread: 2 Guest(s)