07.08.2012, 15:52
Hello, I'm working on my platenumber and phonenumber system, as you may notice I'll need unique numbers for every palyers, I've made a random function that works well, but the problem is that my mysql function to read if there is any current numbers like that doesn't work.
How to check if there is any rows with mysql_function_query? as i do it now is:
but mysql_funcion_query dosen't seems to return anything, do anyone else know why or get better ideas on how to do this?
I'm thnkfull for every answer
How to check if there is any rows with mysql_function_query? as i do it now is:
pawn Код:
//i generate a random number here, then i use this function
format(query, sizeof(query), "SELECT carid FROM publiccars WHERE carplatenocolor = '%s'", string);
if(mysql_function_query(dbHandle, query, true, "CheckRows", "") == 0) return 0;//this returns that the number is availiable and else i return 1;
forward CheckRows();
public CheckRows(){
new rows, fields;
cache_get_data(rows, fields);
if(rows) return 1;
else return 0;
}
I'm thnkfull for every answer
![Cheesy](images/smilies/biggrin.png)