[Help] With strcmp in a MySql login script!
#5

Quote:
Originally Posted by kariok
how can i use the password as a string instead of an integer value?!
mysql_fetch_string()

Not only that, you're not getting any specific field.

I'll update this for you and this shall work.

There's also NO need for a 256-cell string.

This may not work as the field names may be different for you, so make sure you change it all up if you need to.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if (dialogid == login)
  {
        new query[ 128 ], EscapedPass[ 128 ];
       
        mysql_real_escape_string( inputtext, EscapedPass );
       
        format(query,sizeof(query), "SELECT * FROM `usuario` WHERE `login` = '%s' AND `password` = '%s'", PlayerName( playerid ), EscapedPass );
        mysql_query( query );
        mysql_store_result();
       
        if( mysql_num_rows() >= 1 )
        {
          // Success.
        }
        else
        {
          // Failed.
        }
       
        mysql_free_result();
    }
   
    return 1;
}
Reply


Messages In This Thread
[Help] With strcmp in a MySql login script! - by kariok - 21.04.2010, 16:21
Re: [Help] With strcmp in a MySql login script! - by kariok - 23.04.2010, 01:00
Re: [Help] With strcmp in a MySql login script! - by Calgon - 23.04.2010, 01:20
Re: [Help] With strcmp in a MySql login script! - by kariok - 24.04.2010, 02:43
Re: [Help] With strcmp in a MySql login script! - by Calgon - 24.04.2010, 02:48

Forum Jump:


Users browsing this thread: 1 Guest(s)