Little MySQL Problem.
#1

Hello.

Im currently learning some stuffs in MySQL these days. I got lil problem in MySQL. so here is the code:
pawn Код:
public OnPlayerConnect(playerid)
{
    new querry[64],pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(querry,"SELECT `password` FROM `users` WHERE `username` = '%s'",pName);
    mysql_query(querry);
    mysql_store_result();
    return 1;
}
As you guys know, to fix error argument type mismatch (argument 2), We have to do format string and send that string to database. And i did in my code above. But im still getting that error. Did i make a fault?

I hope you guys would help me, as im new in MySQL


thank you
Reply
#2

You forgot the lenght.

pawn Код:
format(querry,sizeof(query),"SELECT `password` FROM `users` WHERE `username` = '%s'",pName);
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You forgot the lenght.

pawn Код:
format(querry,sizeof(query),"SELECT `password` FROM `users` WHERE `username` = '%s'",pName);
Damn LOL!
how did i forgot it? xDDD

Anw, thank you for help

+REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)