24.04.2010, 02:48
Quote:
|
Originally Posted by kariok
how can i use the password as a string instead of an integer value?!
|
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;
}
