MySQL Error
#1

Код:
if(RPName(PlayerName(playerid),first,last))
    {
        
        new Query[128], Name[MAX_PLAYER_NAME], EscapedName[MAX_PLAYER_NAME];// field[3][3];

        GetPlayerName(playerid, Name, sizeof(Name));

        mysql_real_escape_string(Name, EscapedName);

        format(Query, sizeof(Query), "SELECT `dbid` FROM `users` WHERE `username` = '%s'", EscapedName);
        mysql_query(Query);
        mysql_store_result();

        if( mysql_num_rows() >= 1 )
        {        
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login","Your user is registered! Please login with your password below!","Login","Cancel"); //Shows our login dialog :).
            PlayerInfo[playerid][pRegistered] = 1;
        }
        else
        {
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Welcome to External Life Roleplay","To play in this server you must agree to our rules,\n you can read these on http://rp.external-life.net/ \n To create an account you must register on our forum,\n and create an account there, \nthis is to show that you are serious about roleplaying with us. Thank You","Close","");
        }
	}
When this part of my script is executed it spits out this into mysql...

Код:
[15:21:40] ---------------------------

[15:21:40] MySQL Debugging activated (09/12/11)

[15:21:40] ---------------------------

[15:21:40]  

[15:21:40] >> mysql_connect( )

[15:21:40] CMySQLHandler::CMySQLHandler() - constructor called.

[15:21:40] CMySQLHandler::CMySQLHandler() - Connecting to "127.0.0.1" | DB: "elrp" | Username: "root" ...

[15:21:40] CMySQLHandler::Connect() - Connection was successful.

[15:21:40] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.

[15:22:11] >> mysql_real_escape_string( Connection handle: 0 )

[15:22:11] >> mysql_real_escape_string() - Invalid connection handle. (You set: 0, Highest connection handle ID is 1).

[15:22:11] >> mysql_query( Connection handle: 0 )

[15:22:11] >> mysql_query() - Invalid connection handle. (You set: 0, Highest connection handle ID is 1).

[15:22:11] >> mysql_store_result( Connection handle: 0 )

[15:22:11] >> mysql_store_result() - Invalid connection handle. (You set: 0, Highest connection handle ID is 1).

[15:22:11] >> mysql_num_rows( Connection handle: 0 )

[15:22:11] >> mysql_num_rows() - Invalid connection handle. (You set: 0, Highest connection handle ID is 1).
Reply
#2

Seems you make multiple connections to DB, there is like 2 connections ID 0 and ID 1
Reply
#3

Quote:
Originally Posted by Voldemort
Посмотреть сообщение
Seems you make multiple connections to DB, there is like 2 connections ID 0 and ID 1
How would there be multiple connections?
Reply
#4

does anybody have any other idea's on why this would be happening?
Reply
#5

I wanted to post what fixed the issue, so that other people having the problem might be able to try this,

Make sure that your a_mysql.inc version matches the plugin version you are using... i merged some includes from another location and this is what gave me my issue.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)