Sql problem
#1

Hello, when i start my server the server is running but when there is someone who trying to join the server is crashing and this is in my server log, i tried to upgrade the sql plugin from R5 to R7 but then my gamemode gives many errors,

PHP код:
[19/07/2015 16:20:19Number of vehicle models115
[19/07/2015 16:20:49] [connectionrequests connection cookie.
[
19/07/2015 16:20:50Incoming connection:  id0
[19/07/2015 16:20:50] [joinKoen_Brown has joined the server ()
[
19/07/2015 16:20:51] [debugServer crashed while executing SGRP.amx
[19/07/2015 16:20:51] [debugAMX backtrace:
[
19/07/2015 16:20:51] [debug#0 native mysql_real_escape_string () [10006af0] from mysql.DLL
[19/07/2015 16:20:51] [debug#1 001fa33c in public Login () from SGRP.amx
[19/07/2015 16:20:51] [debugSystem backtrace:
[
19/07/2015 16:20:51] [debug#0 746d4951 in ?? () from C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb\MSVCR90.dll
[19/07/2015 16:20:51] [debug#1 746d4996 in ?? () from C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb\MSVCR90.dll
[19/07/2015 16:20:51] [debug#2 10005b71 in ?? () from C:\Users\Koen\Desktop/sgrp\plugins\mysql.DLL
[19/07/2015 16:20:51] [debug#3 10005d7d in ?? () from C:\Users\Koen\Desktop/sgrp\plugins\mysql.DLL
[19/07/2015 16:20:51] [debug#4 10008bd8 in ?? () from C:\Users\Koen\Desktop/sgrp\plugins\mysql.DLL
[19/07/2015 16:20:51] [debug#5 10006bd6 in ?? () from C:\Users\Koen\Desktop/sgrp\plugins\mysql.DLL
[19/07/2015 16:20:51] [debug#6 004010b6 in ?? () from C:\Users\Koen\Desktop/sgrp\samp-server.exe
[19/07/2015 16:20:51] [debug#7 719a3c32 in ?? () from C:\Users\Koen\Desktop/sgrp\plugins\crashdetect.DLL
[19/07/2015 16:20:51] [debug#8 719a6076 in ?? () from C:\Users\Koen\Desktop/sgrp\plugins\crashdetect.DLL
[19/07/2015 16:20:51] [debug#9 7199c05a in ?? () from C:\Users\Koen\Desktop/sgrp\plugins\crashdetect.DLL
[19/07/2015 16:20:51] [debug#10 719a3c5e in ?? () from C:\Users\Koen\Desktop/sgrp\plugins\crashdetect.DLL
[19/07/2015 16:20:51] [debug#11 00481638 in ?? () from C:\Users\Koen\Desktop/sgrp\samp-server.exe
[19/07/2015 16:20:51] [debug#12 0048ea0a in ?? () from C:\Users\Koen\Desktop/sgrp\samp-server.exe 
how to fix this ?
Reply
#2

there is a problem with the mysql_real_escape_string function in the Login() function of your script
Reply
#3

Thanks, and how can i fix this problem ?
Reply
#4

Quote:
Originally Posted by BigBrainAFK
Посмотреть сообщение
there is a problem with the mysql_real_escape_string function in the Login() function of your script
Do you mean this ?

PHP код:
forward Login(playerid);
public 
Login(playerid)
{
    
// Display the main menu
    
ShowMainMenuGUI(playerid);
    
ClearChatbox(playerid);
    
SetPlayerVirtualWorld(playerid0);
    
SetPlayerCameraPos(playerid2022.083740, -1308.26062080.478797);
    
SetPlayerCameraLookAt(playerid1970.506103, -1201.44714325.596593);
    new
        
szQuery[128],
        
szPlayerName[MAX_PLAYER_NAME],
        
szPlayerName2[MAX_PLAYER_NAME];
        
    
GetPlayerName(playeridszPlayerNamesizeof(szPlayerName));
    
    
mysql_real_escape_string(szPlayerNameszPlayerName2g_MySQLConnections[0]);
    
    
// Check MySQL to see if any accounts exist with the specified username on login.
    
format(szQuerysizeof(szQuery), "SELECT COUNT(*) FROM players WHERE Username = '%s'"szPlayerName);
    
mysql_query(szQueryTHREAD_CONFIRM_USERNAMEplayeridg_MySQLConnections[0]);
    
    
ConnectionLog(playeridPlayerInfo[playerid][pID], szPlayerName);
    return 
1;

Reply
#5

i can join now but getting this

PHP код:
errorid1146 errorTable 'sgrp.connections' doesn't exist | callback: OnQueryFinish | query: INSERT INTO connections (PlayerID, AccountID, Username, TimeLoggedIn) VALUES(0, 0, 'Koen_Brown', UNIX_TIMESTAMP(now())) | connection handle: 1 | resultid: 1 | extraid: 0
[19/07/2015 17:08:51] errorid: 1146 | error: Table '
sgrp.connections' doesn't exist callbackOnQueryFinish queryUPDATE connections SET AccountID 162 WHERE PlayerID connection handleresultidextraid
My account is not saving, i need to register everytime.

what to do ?
Reply
#6

bump
Reply
#7

[19/07/2015 17:08:51] errorid: 1146 | error: Table 'sgrp.connections' doesn't exist | callback: OnQueryFinish | query: UPDATE connections SET AccountID = 162 WHERE PlayerID = 0 | connection handle: 1 | resultid: 1 | extraid: 0

Are you sure you've got a table called 'sgrp.connections' in your database?
Reply
#8

No there is not but if i want to create it what need to be in it ?
Reply
#9

PlayerID, AccountID, Username, TimeLoggedIn
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)