issue with strcmp
#1

hi all,
i have a problem with strcmp, it won't return true, i am surely that name in database is as name in array but when i compare between them it return false!. anyone can help;

Код:
enum bInfo
{
 Owner[MAX_PLAYERNAME+1],
 bizName[128]
}
new Bizz[2][bInfo];

//mysql statement to get bizznames

new sql_bizname[128];
cache_get_row(0, 3,sql_bizname);

for(new i = 0; i < sizeof(Bizz); i++){
  if(strcmp(Bizz[i][bizName], sql_bizname, true) == 0 ){
    //do something
  }
}
Reply
#2

Post your code with your MySQL statements.
Reply
#3

Quote:
Originally Posted by oodev
Посмотреть сообщение
i am surely that name in database is as name in array but when i compare between them it return false!
When the 2 strings are equal, it returns false. You may need to use the max length in the cache_get_row function.
pawn Код:
cache_get_row(0, 3, sql_bizname, connectionHandle, sizeof (sql_bizname)); // Change "connectionHandle" to the variable you store the connection handle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)