Help removing color tags from string and what does mysql_function_query returns?
#1

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
Код:
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;
}
Will that work? otherwise what should i do?

Thanks for all answers
Reply
#2

I succeded to fix remove color codes by using strfind, strdel, etc, but i still want the answer of the 2nd question (what does mysql_function_query returns?)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)