10.11.2016, 07:00
Hello guys i have a question about mysql update from r6(i think) to r41
I have this 2 things:
They do same thing? Or i need to call mysql querry first and then get cache from it?(second one)
The function is called everytime an admin set a car to the stock....
I want to learn to update from that old functions to new one, for me of course, you don't know when you need....
I have this 2 things:
Код:
public MySQLCheckCar(carname[]) { new query[128],escstr[MAX_PLAYER_NAME]; mysql_real_escape_string(carname, escstr); format(query, sizeof(query), "SELECT `ID` FROM stock WHERE `Car` = '%s'", escstr); mysql_query(SQL,query); mysql_store_result(); if (mysql_num_rows()==0) { mysql_free_result(); return 0; } else { new strid[32],intid; mysql_fetch_row(strid); intid = strval(strid); mysql_free_result(); return intid; } }
Код:
public MySQLCheckCar(carname[]) { new query[64],intid; mysql_format(query, sizeof(query), "SELECT `ID` FROM stock WHERE `Car` = '%e'", carname); mysql_tquery(SQL,query, "", ""); if(cache_num_rows() > 0) { cache_get_value_name_int(0, "ID",intid); return intid; } }
The function is called everytime an admin set a car to the stock....
I want to learn to update from that old functions to new one, for me of course, you don't know when you need....