23.07.2012, 18:13
Hello, I'm making my car-plate system. so I need to take away all the color tags from the string they input as car-plate so i can compare the data to the others and see that the car-plate is unique, so the first question is what how can i take away color tags from a string?, I've thought of sscanf(string, "p<{cccccc}>%s[9]") or something like that but i don't think it's going to work.
The secound question is what does mysql_function_query returns?
I need to know if there is any rows or not so what I've done is
Will that work? otherwise what should i do?
Thanks for all answers
The secound question is what does mysql_function_query returns?
I need to know if there is any rows or not so what I've done is
Код:
stock CheckIfUsedCarPlate(string[]){ sscanf(string, "p<{cccccc}>" new query[200]; format(query, sizeof(query), "SELECT carid FROM publiccars WHERE platenum = '%s'", string); if(mysql_function_query(dbHandle, query, true, "CheckRows", "") == 0) return 0; else return 1; } public CheckRows(){ new rows, fields; cache_get_data(rows, fields); if(rows) return 1; else return 0; }
Thanks for all answers