#1

Why it can't compare password from table with "inputtext"?

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
        new 
string[500];
        if(
dialogid == 0)
        {
            if(
response && strlen(inputtext) >= && strlen(inputtext) <= 24)
            {
                        
format(string,sizeof(string),"INSERT INTO `players` (`name`, `pass`) VALUES('%s','%s')",PlayerName(playerid),inputtext);
            
mysql_query(string);
                        
TogglePlayerSpectating(playerid0);
            } else {
                
ShowPlayerDialog(playerid,0,DSI,"???????????/Register","??????? ??? ?????? (4-24 ???????):","??","");
                }
            return 
1;
        }
        if(
dialogid == 1)
        {
            if(
response)
            {
                        
format(string,sizeof(string),"SELECT * FROM `players` WHERE `name` = '%s' LIMIT 1",PlayerName(playerid));
                        
mysql_store_result();
                        new 
result[500];
                        if(
mysql_fetch_row(result))
                        {
                                
BaseGet("pass",string);
                                
SendClientMessage(playerid,COLOR_RED,string);
                                if(
strcmp(string,inputtext,false,24) == 0TogglePlayerSpectating(playerid0);
                        } else {
                                
ShowPlayerDialog(playerid,1,DSI,"????/Login","??????? ??? ??????:","??","");
                        }
                        
mysql_free_result();
                        return 
1;
                }
        }
        return 
1;

PHP код:
BaseGet(fieldi[],permi[])
{
        new 
string[255];
        
mysql_get_field(fieldi,string);
        
format(permi,500,"%s",string);

PHP код:
[20:28:38] ---------------------------
[
20:28:38MySQL Debugging activated (02/08/14)
[
20:28:38] ---------------------------
[
20:28:38]  
[
20:28:38] >> mysql_pingConnection handle)
[
20:28:38CMySQLHandler::Ping() - Connection is still alive.
[
20:28:38] >> mysql_queryConnection handle)
[
20:28:38CMySQLHandler::Query(SELECT FROM `playersWHERE `name` = 'kilohertz' LIMIT 1) - Successfully executed.
[
20:28:38] >> mysql_store_resultConnection handle)
[
20:28:38CMySQLHandler::StoreResult() - Result was stored.
[
20:28:38] >> mysql_fetch_row_formatConnection handle)
[
20:28:38CMySQLHandler::FetchRow() - Return: 1|kilohertz|syndi|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
[20:28:38] >> mysql_free_resultConnection handle)
[
20:28:38CMySQLHandler::FreeResult() - Result was successfully free'd.
[20:28:42] >> mysql_store_result( Connection handle: 1 )
[20:28:42] CMySQLHandler::StoreResult() - No data to store.
[20:28:42] >> mysql_fetch_row_format( Connection handle: 1 )
[20:28:42] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)
[20:28:42] >> mysql_free_result( Connection handle: 1 )
[20:28:42] CMySQLHandler::FreeResult() - The result is already empty.
[20:28:46] >> mysql_store_result( Connection handle: 1 )
[20:28:46] CMySQLHandler::StoreResult() - No data to store.
[20:28:46] >> mysql_fetch_row_format( Connection handle: 1 )
[20:28:46] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)
[20:28:46] >> mysql_free_result( Connection handle: 1 )
[20:28:46] CMySQLHandler::FreeResult() - The result is already empty.
[20:29:22] >> mysql_ping( Connection handle: 1 )
[20:29:22] CMySQLHandler::Ping() - Connection is still alive.
[20:29:22] >> mysql_query( Connection handle: 1 )
[20:29:22] CMySQLHandler::Query(SELECT * FROM `players` WHERE `name` = '
kilohertz' LIMIT 1) - Successfully executed.
[20:29:22] >> mysql_store_result( Connection handle: 1 )
[20:29:22] CMySQLHandler::StoreResult() - Result was stored.
[20:29:22] >> mysql_fetch_row_format( Connection handle: 1 )
[20:29:22] CMySQLHandler::FetchRow() - Return: 1|kilohertz|syndi|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
[20:29:22] >> mysql_free_result( Connection handle: 1 )
[20:29:22] CMySQLHandler::FreeResult() - Result was successfully free'
d.
[
20:29:28] >> mysql_store_resultConnection handle)
[
20:29:28CMySQLHandler::StoreResult() - No data to store.
[
20:29:28] >> mysql_fetch_row_formatConnection handle)
[
20:29:28CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)
[
20:29:28] >> mysql_free_resultConnection handle)
[
20:29:28CMySQLHandler::FreeResult() - The result is already empty.
[
20:29:32] >> mysql_store_resultConnection handle)
[
20:29:32CMySQLHandler::StoreResult() - No data to store.
[
20:29:32] >> mysql_fetch_row_formatConnection handle)
[
20:29:32CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)
[
20:29:32] >> mysql_free_resultConnection handle)
[
20:29:32CMySQLHandler::FreeResult() - The result is already empty. 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)