Need Help With Mysql -
titanak - 19.10.2011
Hello i have problem with mysql the mysql SET , saving works but if i try to login then it doesn't give me right values what is at Database.
if i register and then quit then it saves all the data . but , when i go back to the server then enter the password and clicking login then it doesnt show the Login message too .. and does not set me pvar ints too.
Login Script:
The SQL Log:
Код:
[00:49:04] CMySQLHandler::Query(SELECT skoor, raha, admin, sugu, vanus, vaatamisi, registriaeg, tapmisi, surmasi, odo, mhz, PRelv1, PRelv2 FROM kasutajad WHERE kasutajanimi = 'titanak') - Successfully executed.
[00:49:04] >> mysql_store_result( Connection handle: 1 )
[00:49:04] CMySQLHandler::StoreResult() - Result was stored.
[00:49:04] >> mysql_fetch_row_format( Connection handle: 1 )
[00:49:04] CMySQLHandler::FetchRow() - Return: 0|0|0|1|16|1|20/10/2011|0|0|0|150|0|0
[00:49:04] >> mysql_fetch_field_row( Connection handle: 1 )
[00:49:04] CMySQLHandler::FetchField("skoor") - 0
[00:49:04] >> mysql_fetch_field_row( Connection handle: 1 )
[00:49:04] CMySQLHandler::FetchField("raha") - 0
[00:49:08] >> mysql_real_escape_string( Connection handle: 1 )
[00:49:08] CMySQLHandler::EscapeString(); - Escaped 0 characters to .
i think this is enough info.. i am very thanks if someone help me to fix it reping too.
Re: Need Help With Mysql -
titanak - 20.10.2011
anyone got suggestions ?``
i am new at mysql.
Re: Need Help With Mysql -
[MWR]Blood - 20.10.2011
Try using sscanf to load the data! A lot better. You can download some MySQL registration filterscripts to see how it is done.
Re: Need Help With Mysql -
System64 - 20.10.2011
Quote:
Originally Posted by [MWR]Blood
Try using sscanf to load the data! A lot better. You can download some MySQL registration filterscripts to see how it is done.
|
With sscanf it doesn't wokr (to me)
I suggest you to use normal variables, here is exaple how I use it for loading
pawn Код:
mysql_fetch_field_row(savingstring, "Novac"); PlayerInfo[playerid][pMoney] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Ubojstva"); PlayerInfo[playerid][pKills] = strval(savingstring);
Re: Need Help With Mysql -
titanak - 20.10.2011
Quote:
Originally Posted by System64
With sscanf it doesn't wokr (to me)
I suggest you to use normal variables, here is exaple how I use it for loading
pawn Код:
mysql_fetch_field_row(savingstring, "Novac"); PlayerInfo[playerid][pMoney] = strval(savingstring); mysql_fetch_field_row(savingstring, "Ubojstva"); PlayerInfo[playerid][pKills] = strval(savingstring);
|
i hate sscanf idk why but i hate it.
but do i have to change pvars to PlayerInfo system
Re: Need Help With Mysql -
System64 - 20.10.2011
Quote:
Originally Posted by titanak
i hate sscanf idk why but i hate it.
but do i have to change pvars to PlayerInfo system
|
You shoud, they are faster and easier
Re: Need Help With Mysql -
titanak - 20.10.2011
Quote:
Originally Posted by titanak
i hate sscanf idk why but i hate it.
but do i have to change pvars to PlayerInfo system
|
The first one is Kills , and the 2nd one is Deaths.
Код:
mysql_fetch_field_row(savingstring, "tapmisi"); SetPVarInt(playerid, "Tapmisi",strval(savingstring));
mysql_fetch_field_row(savingstring, "surmasi"); SetPVarInt(playerid, "Surmasi",strval(savingstring));
Re: Need Help With Mysql -
titanak - 20.10.2011
Quote:
Originally Posted by System64
You shoud, they are faster and easier
|
okey tryed that:
still doesn't give me the right values on login.
and now comes randomly SERVER UNKNOWN COMMAND if i try any command.... wtf..
Re: Need Help With Mysql -
System64 - 20.10.2011
you don't need savingstring2 and set savingstring on 1000
Re: Need Help With Mysql -
titanak - 20.10.2011
Quote:
Originally Posted by System64
you don't need savingstring2 and set savingstring on 1000
|
tryed 1000 , not worked tryed 2012 not worked... wtf is wrong with this i cannot understand..
i think there is problem with this: mysql_free_result();
the welcome message is after: mysql_free_result(); and if this returns 0 then it returns everything 0 or whatafaak..
ok found the bug . this happens when i quit and relog with no server restarting.
Log says
Код:
[12:45:21] CMySQLHandler::FetchRow() - Return: 0|0|0|1|16|2|20/10/2011|0|0|0|150|0|0
[12:45:21] >> mysql_fetch_field_row( Connection handle: 1 )
[12:45:21] CMySQLHandler::FetchField("skoor") - 0
[12:45:21] >> mysql_fetch_field_row( Connection handle: 1 )
[12:45:21] CMySQLHandler::FetchField("raha") - 0
[12:45:24] >> mysql_real_escape_string( Connection handle: 1 )
[12:45:24] CMySQLHandler::EscapeString(); - Escaped 0 characters to .