MySQL connection. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL connection. (
/showthread.php?tid=445676)
MySQL connection. -
BaubaS - 22.06.2013
Sometimes when I send a query (no matter how does it look like), mysql_debug prints that handle is invalid:
Quote:
[17:22:36] >> mysql_query_callback() - Invalid connection handle. (You set: 0, Highest connection handle ID is 1).
|
or
Quote:
[17:22:36] >> mysql_query_callback() - Invalid connection handle. (You set: 0, Highest connection handle ID is 0).
|
Or sometimes it says that there is an error in the query, but OnQueryError doesnt print anything.
Re: MySQL connection. -
Oscii - 22.06.2013
Show me the query your trying to handle.
Re: MySQL connection. -
BaubaS - 22.06.2013
As I said there's no difference. You can send for example
Quote:
UPDATE `existing_table_name` SET `field_name` = 'value' WHERE `something` = 'value'
|
Quote:
SELECT * FROM `existing_table_name` WHERE `field_name` = 'value'
|
And boom - here comes the message that connection handle is wrong.
___________________
And looks like it now says that connection handle is wrong on every query. Could it be this function? I just started using it some days ago, dunno if it is.
pawn Код:
function mysql_real_escape_stringex(str[])
{
new escapedString[64];
mysql_real_escape_string(str, escapedString);
return escapedString;
}
Re: MySQL connection. -
Scenario - 22.06.2013
You're using 0 as the connection handle when you're supposed to be using 1- the error even says that!
Re: MySQL connection. -
BaubaS - 22.06.2013
Noup. Look, an example:
Quote:
[17:50:30] >> mysql_query_callback( Connection handle: 0 )
[17:50:30] >> mysql_query_callback() - Invalid connection handle. (You set: 0, Highest connection handle ID is 0).
[17:50:30] >> mysql_connect(localhost, root, test, ******) on port 3306
[17:50:30] CMySQLHandler::CMySQLHandler() - constructor called.
[17:50:30] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "test" | Username: "root"
[17:50:30] CMySQLHandler::Connect() - Connection was successful.
[17:50:30] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
[17:50:30]
[17:50:30] ** MySQL Debugging enabled (06/22/13)
[17:50:30]
[17:50:30] >> mysql_ping( Connection handle: 1 )
[17:50:30] CMySQLHandler::Ping() - Connection is still alive.
|
And then, after sending a query somewhy it loggs off. The settings are right, XAMPP/WAMPP connection is online too.
Re: MySQL connection. -
BaubaS - 22.06.2013
Bumping this shit xd
Re: MySQL connection. -
Scenario - 22.06.2013
https://sampforum.blast.hk/showthread.php?tid=64144
Reporting that shit.
Re: MySQL connection. -
BaubaS - 22.06.2013
Damn, you must feel like a hero now! Go and scan other threads, I promise there is going to be many members which are bumping their threads minutes after the last post.
Stop being a drama queen, just report it and its all done, instead of cursing other members.
Re: MySQL connection. -
Scenario - 23.06.2013
You've been registered here for 2 years so you must of knowingly broke the forum rules. It's not my fault.
Re: MySQL connection. -
Kirollos - 23.06.2013
Quote:
Originally Posted by BaubaS
Noup. Look, an example:
And then, after sending a query somewhy it loggs off. The settings are right, XAMPP/WAMPP connection is online too.
|
that shows you runned a query before connecting to mysql