mysql r33 checking is player in DB
#1

PHP код:
      mysql_format(dbHandleg_szBuffer120"SELECT * FROM `"MySQL_PLAYERS_TABLE"` WHERE `pName` = '%s'"getPlayerName(playerid));
      new 
rowsfields;
    
cache_get_data(rowsfieldsdbHandle);
      if(
rows)
      {
          
cache_get_field_content(0"pPw"player[playerid][pPw], dbHandle130);
          
loginPlayer(playerid);
      }
      else
      {
          
registerPlayer(playerid);
      } 
I think the code should work good but when I connect with the exsisting account I still get register dialog, not login.
Reply
#2

PHP код:
mysql_format(dbHandle,query,sizeof(query),"SELECT pPw FROM "MySQL_PLAYERS_TABLE" WHERE pName='%e' LIMIT 0,1",
GetPlayerName(playerid));
new 
Cache:cquery=mysql_query(dbHandle,query);
if(
cache_num_rows()){
     
cache_get_field_content(0"pPw"player[playerid][pPw], dbHandle130); 
     
loginPlayer(playerid); 
}else{
     
registerPlayer(playerid);
}
cache_delete(cquery); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)