Quote:
Originally Posted by devWaleed
PHP Code:
public SELECT_Handler(FailState, Handle:Query, Error[], Errcode, Data[], DataSize){
if(FailState == TQUERY_CONNECT_FAILED){
return set_fail_state("Couldn't connect to DB");
}else if(FailState == TQUERY_QUERY_FAILED){
return set_fail_state("Query failed");
}
//num = SQL_NumResults(Query);
if(SQL_NumResults(Query) == 1){
num = SQL_ReadResult(Query, 2);
client_print(0, print_chat, "Flag is %s", num);
}
return PLUGIN_CONTINUE;
}
Problem here is it is not printing what flags I have in MYSQL database.
On line 12: It prints "Flag is " and doesn't prints flags.
Database structure:
http://i.minus.com/ibpeuIuxaT1jGf.png
|
there's so many things wrong with this
you're trying to print an int by the %String operator
this will only work if there's only one single row that applies to the query
if you want to save the flags as a string, make it SQL_ReadResult(Query, 2, szString, [len]);
__________________