18.03.2015, 22:14
MySQL плагин закрывает соединение до выполнения всех запросов.
Так и должно быть?
mysql_log.txt:
Код:
Так и должно быть?
mysql_log.txt:
Quote:
|
[23:39:43] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [23:39:43] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [23:39:43] [DEBUG] CMySQLConnection::Connect - connection was successful [23:39:43] [DEBUG] CMySQLConnection::Connect - connection was successful [23:39:43] [DEBUG] CMySQLConnection::Connect - connection was successful [23:39:43] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [23:39:43] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [23:39:43] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [23:39:48] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `model` FROM `test` WHERE `id` = 1", callback: "(null)", format: "(null)" [23:39:48] [DEBUG] mysql_close - connection: 1 [23:39:48] [DEBUG] CMySQLConnection::Disconnect - connection was closed [23:39:48] [DEBUG] CMySQLConnection::Disconnect - connection was closed [23:39:48] [DEBUG] CMySQLConnection::Disconnect - connection was closed [23:39:48] [DEBUG] CMySQLHandle::~CMySQLHandle - deconstructor called |
PHP код:
#include <a_samp>
#include <a_mysql>
main() {}
public OnGameModeInit()
{
mysql_connect("127.0.0.1", "root", "test", "");
mysql_log(LOG_ALL);
return 1;
}
public OnRconCommand(cmd[])
{
if(!strcmp(cmd, "papapa", true))
{
mysql_tquery(1, "SELECT `model` FROM `test` WHERE `id` = 1", "", "");
mysql_close();
return 1;
}
return 0;
}

