Crashing [ MySQL ]
#1

Crashing at this :
pawn Code:
mysql_real_escape_string(PlayerName(playerid), Escape[2]);
Crashdetect :
Code:
Loaded debug symbols from gamemodes\....amx
The server has been crashed by native mysql_real_escape_string at line 93 in file BlaBlaBla.pwn.
Stack trace (most recent call first):
Reply
#2

Show me your PlayerName function and the initialization of the "Escape" array. Also as far as I know, that function requires a connection to the MySQL server before being called, so make sure the connection exists.
Reply
#3

Quote:
Originally Posted by JaTochNietDan
View Post
Show me your PlayerName function and the initialization of the "Escape" array.
What is initialization of the "Escape" array?
Reply
#4

Quote:
Originally Posted by DiiP
View Post
What is initialization of the "Escape" array?
Show me where you create it, and show me the contents of the PlayerName function, also read the edit I made in my post.
Reply
#5

Quote:
Originally Posted by JaTochNietDan
View Post
Show me where you create it, and show me the contents of the PlayerName function, also read the edit I made in my post.
pawn Code:
new Escape[5][128];

stock PlayerName(playerid)
{
      new name[MAX_PLAYER_NAME];
      GetPlayerName(playerid, name, sizeof(name));
      return name;
}
Reply
#6

Quote:
Originally Posted by DiiP
View Post
pawn Code:
new Escape[5][128];

stock PlayerName(playerid)
{
      new name[MAX_PLAYER_NAME];
      GetPlayerName(playerid, name, sizeof(name));
      return name;
}
Okay and what about the other part of my post? Are you sure that a connection to the MySQL server exists when the function is called?

Also did you try enabling MySQL debugging and reading the MySQL logs to see what it says?
Reply
#7

[16:41:33]

[16:41:33] ---------------------------

[16:41:33] MySQL Debugging activated (10/17/11)

[16:41:33] ---------------------------

[16:41:33]

[16:41:33] >> mysql_connect( )

[16:41:33] CMySQLHandler::CMySQLHandler() - constructor called.

[16:41:33] CMySQLHandler::CMySQLHandler() - Connecting to "127.0.0.1" | DB: "database" | Username: "database" ...

[16:41:33] CMySQLHandler::Connect() - Access denied for user 'database'@'localhost' (using password: YES) (Error ID: 1045)

[16:41:33] >> mysql_query( Connection handle: 1 )

[16:41:33] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead)
Reply
#8

Well there's your problem, read the log instead of posting it here, as I'm sure you can read it and see the problem immediately. As it says you have no connection to the database when the function is called, and as it says the reason you're not able to connect to the database is because access was denied, which means you're getting a connection but the details are incorrect.

So you need to use the correct login details for your database in order to connect to it.
Reply
#9

Quote:
Originally Posted by JaTochNietDan
View Post
Well there's your problem, read the log instead of posting it here, as I'm sure you can read it and see the problem immediately. As it says you have no connection to the database when the function is called, and as it says the reason you're not able to connect to the database is because access was denied, which means you're getting a connection but the details are incorrect.

So you need to use the correct login details for your database in order to connect to it.
I don't understand what you mean, sir.
Reply
#10

What's not to understand? The errors are extremely obvious, read the log. You're trying to connect to the MySQL server but the login details are incorrect, you need to login using the correct details.

When you login on your SA-MP account on these forums, you type in the correct username + password, not the wrong one. The same applies for connecting to a MySQL server.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)