16.08.2015, 15:18
Код:
stock saveDealer(const id) { format(szLargeString, sizeof(szLargeString), "UPDATE dealer SET stock = `%d`, price = `%d`, Pprice = `%d`, name = `%s` WHERE carID = `%d`", vehSlots[id],vehPrice[id],vehPprice[id],vehName[id],id); mysql_tquery(handle,szLargeString); return 1; }
Код:
public IniDealer() { new Cache: result3 = mysql_query (handle, "SELECT * FROM `dealer` ORDER BY `dealer`.`carID` ASC"); new x; for ( new i, j = cache_get_row_count ( ); i != j; ++i ) { cache_get_field_content(i, "carID", result); x = strval(result); DSModele[i] = x; cache_get_field_content(i, "stock", result); vehSlots[x] = strval(result); cache_get_field_content(i, "price", result); vehPrice[x] = strval(result); cache_get_field_content(i, "Pprice", result); vehPprice[x] = strval(result); cache_get_field_content(i, "name", result); format(vehName[x], 32, result); } cache_delete(result3); return 1; }