pBlueG / SA-MP-MySQL

MySQL plugin for San Andreas Multiplayer
BSD 3-Clause "New" or "Revised" License
194 stars 81 forks source link

Your MariaDB server version for the right syntax #258

Open raedman90 opened 3 years ago

raedman90 commented 3 years ago

Good afternoon, I am using the mysql R41-3 plugin and I have this problem.

[04/28/21 14:36:15] [DEBUG] CConnection::CConnection(this=0xec67c008, host='IP', user='USER', passw='PASS', db='logs_servidor', options=0x97ede98) [04/28/21 14:36:15] [DEBUG] CConnection::CConnection - new connection = 0x9888af8 [04/28/21 14:36:15] [DEBUG] CThreadedConnection::CThreadedConnection(this=0xec67c008, connection=0xec67c008) [04/28/21 14:36:15] [DEBUG] CThreadedConnection::WorkerFunc(this=0xec67c008, connection=0xec67c008) [04/28/21 14:36:15] [INFO] Connection handle with id '1' successfully created. [04/28/21 14:36:15] [DEBUG] CHandleManager::Create - new handle = 0x97a2758 [04/28/21 14:36:15] [DEBUG] mysql_connect: return value: '1'

[04/28/21 14:42:26] [ERROR] mysql_format: invalid connection handle '0' [04/28/21 14:42:26] [ERROR] error #1065 while executing query "": Query was empty [04/28/21 14:42:26] [ERROR] mysql_format: invalid connection handle '0' [04/28/21 14:42:26] [ERROR] error #1065 while executing query "": Query was empty [04/28/21 14:42:29] [ERROR] error #1064 while executing query "er Logs:{ffffff} ComandoLog ": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'er Logs:{ffffff} ComandoLog' at line 1

I am not able to find the error, only that the version of mysql server is different

IstuntmanI commented 3 years ago
[04/28/21 14:42:29] [ERROR] error #1064 while executing query "er Logs:{ffffff} ComandoLog
": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'er Logs:{ffffff} ComandoLog' at line 1

This is a basic error that tells you that the query syntax is invalid. Are you sure that you query string is correctly formatted? The log looks weird. In that log I also see that you are trying to use mysql_format on an invalid connection handle.

raedman90 commented 3 years ago

`LogMin[playerid] = 0; LogMax[playerid] = LogMin[playerid]+25;

ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Filtro de Logs", "{B4B5B7}WE ARE LOOKING FOR WAIT...", "Fechar", ""); mysql_tquery(MySQL_logs, fmat_return("SELECT * FROM %s ORDER BY log_data DESC LIMIT %d,%d;", logname, LogMin[playerid], LogMax[playerid]), "PesquisarLog", "ds", playerid, logname);`

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'er Logs:{ffffff} ComandoLog' at line 1

The error is in that last line

The other connection already solve