23.03.2013, 14:44
My server saves to the database on disconnect, saves newly registered users to it, and updates.. but for some reason I can't get the darn thing to load what I have set in
It looks like this in the db
DatabaseName
TableName
--colummns-
username(vstr)
password(vstr)
money(int)
skin(int)
x(float)
y(float)
z(float)
The code looks like this:
heres the errorlogs
What am I doing wrong?
Edit: now the the server is closing on me.... same code...
Edit2: Ran that query through my apache server and it went without a problem... halp..
It looks like this in the db
DatabaseName
TableName
--colummns-
username(vstr)
password(vstr)
money(int)
skin(int)
x(float)
y(float)
z(float)
The code looks like this:
Код:
new query[200], pname[24], savingstring[200]; GetPlayerName(playerid, pname, 24); format(query, sizeof(query), "SELECT * FROM `playerdata` WHERE `username` = '%s'", pname); //Doesn't that query Look just fine? its odd because I get an error in my console before reaching code below. mysql_query(query); mysql_store_result(); while(mysql_fetch_row_format(query,"|")) { SendClientMessage(playerid, 0xFFFFFFFF, "Makes it this far."); //sscanf(savingstring,"p<|>{s[100]}{s[100]}iifff{s[100]}",PlayerInfo[playerid][pMoney],PlayerInfo[playerid][pSkin],PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]); //was trying to skip variables and read others here, but the error i get from the above code doesn't allow me to get this far :p } SendClientMessage(playerid, PlayerInfo[playerid][pMoney]); mysql_free_result(); //We must always free a stored result SendClientMessage(playerid, -1, "Welcome back to {88AA88}Limbo Roleplay {88AA88}"); //Sends the client a message. IsLoggedIn[playerid] = 1; //Sets our logged in variable to one ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_WHITE"Press Ok to continue.","Ok",""); return 1; }
Код:
[09:45:10] [debug] Server crashed while executing bare.amx [09:45:10] [debug] AMX backtrace: [09:45:10] [debug] #0 native mysql_fetch_field_row () [01d96700] from mysql.DLL [09:45:10] [debug] #1 0000e868 in ?? () from bare.amx [09:45:10] [debug] #2 0000e3f8 in public OnDialogResponse () from bare.amx [09:45:10] [debug] System backtrace: [09:45:11] [debug] #0 01d9952e in ?? () from C:\Users\Matthew\Documents\SA-MP server\plugins\mysql.DLL [09:45:11] [debug] #1 01d967d3 in ?? () from C:\Users\Matthew\Documents\SA-MP server\plugins\mysql.DLL [09:45:11] [debug] #2 004010b6 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #3 72b6340a in ?? () from C:\Users\Matthew\Documents\SA-MP server\plugins\crashdetect.DLL [09:45:11] [debug] #4 72b65aa6 in ?? () from C:\Users\Matthew\Documents\SA-MP server\plugins\crashdetect.DLL [09:45:11] [debug] #5 72b5d621 in ?? () from C:\Users\Matthew\Documents\SA-MP server\plugins\crashdetect.DLL [09:45:11] [debug] #6 72b6345a in ?? () from C:\Users\Matthew\Documents\SA-MP server\plugins\crashdetect.DLL [09:45:11] [debug] #7 0046da61 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #8 004527d0 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #9 7759e023 in ?? () from C:\Windows\SysWOW64\ntdll.dll [09:45:11] [debug] #10 770714d1 in ?? () from C:\Windows\syswow64\kernel32.dll [09:45:11] [debug] #11 004a3fce in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #12 68106ac3 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #13 004b2c88 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #14 ffe2aae8 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #15 00498ce9 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #16 46736c46 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #17 00656572 in ?? () [09:45:11] [debug] #18 53736c46 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #19 61567465 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #20 0065756c in ?? () [09:45:11] [debug] #21 47736c46 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #22 61567465 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #23 0065756c in ?? () [09:45:11] [debug] #24 41736c46 in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe [09:45:11] [debug] #25 636f6c6c in ?? () from C:\Users\Matthew\Documents\SA-MP server\samp-server.exe
Edit: now the the server is closing on me.... same code...
Edit2: Ran that query through my apache server and it went without a problem... halp..