22.12.2015, 11:02
Quote:
Код:
Query the following: CREATE TABLE IF NOT EXISTS `bank` (`Balance` INTEGER DEFAULT 0 NOT NULL, `Manager` VARCHAR(24), `ID` INTEGER NOT NULL PRIMARY KEY) Enumerator Example: Код:
enum BankData { bID, bBalance, bManager[24], }; new bData[MAX_BANK][BankData]; Код:
"UPDATE `bank` SET `Balance` = %d, `Manager` = '%s' WHERE `ID` = %d", bData[bankid][bBalance], bData[bankid][bManager], bData[bankid][bID] Код:
"SELECT * FROM `bank` WHERE `ID` = %d", bData[bankid]); new rows, fields; cache_get_data(rows, fields, serverhandle); for (new i = 0; i < rows; i ++) { bData[bankid][bID] = cache_get_field_int(i, "ID") bData[bankid][bBalance] = cache_get_field_int(i, "Balance") cache_get_field_content(i, "Manager", bData[bankid][bManager], serverhandle, 24); } |
That's a complete answer.
+1337REP