Reading from database
#3

When I try to print the password on my screen through SendClientMessage, only an empty row appears in the chatlog. I tried wil full and empty strings, all show the same. I've made the string to be empty by default, and I am sure the table and database are existing and correct. I also have text-type data in the specified field.
I think I am not using these lines properly:
pawn Код:
format(str, sizeof(str), "SELECT Password FROM `Players` WHERE Name = '%s'", playername);
new DBResult:result=db_query(playerlog, str);
db_get_field_assoc(result, "Password", pass, sizeof(pass));
Probably something wrong with the db_query and db_get_field_assoc...

And sorry for bumping, I think I must go read the rules.
Reply


Messages In This Thread
Reading from database - by ArcherTRP - 27.07.2011, 16:24
Re: Reading from database - by Grim_ - 28.07.2011, 07:29
Re: Reading from database - by ArcherTRP - 28.07.2011, 13:54
Re: Reading from database - by Calgon - 28.07.2011, 13:56
Re: Reading from database - by ArcherTRP - 28.07.2011, 13:59

Forum Jump:


Users browsing this thread: 1 Guest(s)