thankyou
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Echelon v2 is not yet officially released! If you cannot get this dev-version installed, revert to version 1 as available in our download section.

Author Topic: MYSQL Syntax Error - Chatlog  (Read 4562 times)

Offline Glock

  • Sr. Member
  • ****
  • Posts: 172
  • Running B3 on 4 busy BF3 servers myself! B3 FTW!
MYSQL Syntax Error - Chatlog
« on: June 24, 2012, 06:46:29 PM »
Hi,

I've installed Echelon and am seeing some errors throughout the tool.

Mainly, whenever I click 'Chat', this is the error I receive;

Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY id DESC LIMIT 0, 25' at line 1

I've since uninstalled the chatlog sql and reinstalled.
The tables are there fine, but I can't see where the error could be.

I'm assuming it's likely to be part of this?

Code: [Select]
mysql_select_db($database_b3connect, $b3connect);
$query_rs_chats = sprintf("SELECT * FROM $chat_db ORDER BY %s %s", $xlorderby_rs_chats,$xlorder_rs_chats);
$query_limit_rs_chats = sprintf("%s LIMIT %d, %d", $query_rs_chats, $startRow_rs_chats, $maxRows_rs_chats);
$rs_chats = mysql_query($query_limit_rs_chats, $b3connect) or die(mysql_error());
$row_rs_chats = mysql_fetch_assoc($rs_chats);
if (isset($_GET['totalRows_rs_chats'])) {
  $totalRows_rs_chats = $_GET['totalRows_rs_chats'];
} else {
  $count_rs_chats = mysql_query("SELECT COUNT(*) numrows FROM $chat_db");
  $count_row_rs_chats = mysql_fetch_assoc($count_rs_chats);
  $totalRows_rs_chats = $count_row_rs_chats['numrows'];


I also get errors such as this when checking any kicks;
Code: [Select]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `client_id` = 2222 ORDER BY `msg_time` DESC LIMIT 0, 50' at line 1
I would appreciate any help at all with this - it's a b3 server from home which works flawlessly.
I'm using phpMyAdmin 3.4.10.1
and mysql version including ubuntu version;
5.5.24-0ubuntu0.12.04.1

Many thanks in advance and I look forward to hearing from you
Need B3 Bot Hosting for your gameservers in the UK & Europe?
Take a look at Rcon-Admin.com
Cheap + reliable B3 Bot hosting in the UK and Europe

Offline Glock

  • Sr. Member
  • ****
  • Posts: 172
  • Running B3 on 4 busy BF3 servers myself! B3 FTW!
Re: MYSQL Syntax Error - Chatlog
« Reply #1 on: December 20, 2012, 10:57:40 AM »
Got this damn bug again!!

Any ideas as to how I can fix this?
I'm using phpmyadmin v3.5.4

It must be the way in which the query is being called.. Or out of date phrases with phpmyadmin? can anyone please help?
« Last Edit: December 20, 2012, 01:23:43 PM by Glock »
Need B3 Bot Hosting for your gameservers in the UK & Europe?
Take a look at Rcon-Admin.com
Cheap + reliable B3 Bot hosting in the UK and Europe

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2628
Re: MYSQL Syntax Error - Chatlog
« Reply #2 on: December 20, 2012, 03:45:17 PM »
You would first need to find out what part of the sql query your version of mysql doesn't like.

You can do this using phpmyadmin and editing a similar query until it works to see what it doesn't like.

You should also make sure that your chat tables have all the right rows in them.

Offline Glock

  • Sr. Member
  • ****
  • Posts: 172
  • Running B3 on 4 busy BF3 servers myself! B3 FTW!
Re: MYSQL Syntax Error - Chatlog
« Reply #3 on: December 20, 2012, 03:50:31 PM »
I've literally re-installed the chatlogger databases (sql) provided from here on a fresh install and still get these.

The rows and data are only what you guys have written.
When it comes to executing SQL queries even to debug - I've no idea.
Need B3 Bot Hosting for your gameservers in the UK & Europe?
Take a look at Rcon-Admin.com
Cheap + reliable B3 Bot hosting in the UK and Europe

Offline Glock

  • Sr. Member
  • ****
  • Posts: 172
  • Running B3 on 4 busy BF3 servers myself! B3 FTW!
Re: MYSQL Syntax Error - Chatlog
« Reply #4 on: December 20, 2012, 06:43:43 PM »
I'm currently getting some help from a mysql/php board and they want to know exactly what is calling the sql query.

I have inserted code from the chats.php but they think it's wrong.
Where is the code needed for this call for the chats to be displayed correctly in Echelon?

Thanks for the help
Need B3 Bot Hosting for your gameservers in the UK & Europe?
Take a look at Rcon-Admin.com
Cheap + reliable B3 Bot hosting in the UK and Europe

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2628
Re: MYSQL Syntax Error - Chatlog
« Reply #5 on: December 20, 2012, 08:04:05 PM »
It looks like the code you found is the correct piece of code, but it gets its values from elsewhere in the code.

Which version of Echelon are you using?

It's possible that your version of mysql uses a different syntax for the 'ORDER BY id DESC LIMIT 0, 25'

Or the other possibility is that you have an entry in one of the tables that contains a character that is interfering with the syntax in some way.

Try running this sql on the chatlog table in phpmyadmin and see what result you get.

Code: [Select]
SELECT * FROM 'chatlog' WHERE `client_id` = 2222 ORDER BY `msg_time` DESC LIMIT 0, 50

Offline Glock

  • Sr. Member
  • ****
  • Posts: 172
  • Running B3 on 4 busy BF3 servers myself! B3 FTW!
Re: MYSQL Syntax Error - Chatlog
« Reply #6 on: December 20, 2012, 08:34:00 PM »
Hi mate,
Thank you for your help and attention here.. it's getting to me if I'm honest.  ::)

So, here is the result from the query;
Code: [Select]
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''chatlog' WHERE `client_id` = 2222 ORDER BY `msg_time` DESC LIMIT 0, 50' at line 1

This is on Echelon V1
I've used V2 previously and it's very nice, but as it's not fully finished it's something we have to be careful with I guess.

Anyway, I really appreciate your help, if you need any more info just ask.
Thanks very much indeed.
Need B3 Bot Hosting for your gameservers in the UK & Europe?
Take a look at Rcon-Admin.com
Cheap + reliable B3 Bot hosting in the UK and Europe

Offline Glock

  • Sr. Member
  • ****
  • Posts: 172
  • Running B3 on 4 busy BF3 servers myself! B3 FTW!
Re: MYSQL Syntax Error - Chatlog
« Reply #7 on: December 20, 2012, 08:49:44 PM »
THIS command works, it works fine but I don't know if it's correct..

SELECT * FROM `chatlog` WHERE  `client_id` = '2222' ORDER BY `msg_time` DESC LIMIT 0, 50
Need B3 Bot Hosting for your gameservers in the UK & Europe?
Take a look at Rcon-Admin.com
Cheap + reliable B3 Bot hosting in the UK and Europe

Offline Glock

  • Sr. Member
  • ****
  • Posts: 172
  • Running B3 on 4 busy BF3 servers myself! B3 FTW!
Re: MYSQL Syntax Error - Chatlog
« Reply #8 on: December 20, 2012, 09:48:09 PM »
A fresh uninstall / reinstall of Echelon fixed it...
After all this time a new install fixed it and I have no idea what it was or is.     :o   ::)  
Need B3 Bot Hosting for your gameservers in the UK & Europe?
Take a look at Rcon-Admin.com
Cheap + reliable B3 Bot hosting in the UK and Europe

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2628
Re: MYSQL Syntax Error - Chatlog
« Reply #9 on: December 20, 2012, 11:41:11 PM »
Did you use the same download as before, or did you download a new copy?

Offline Noobtac

  • Newbie
  • *
  • Posts: 1
Re: MYSQL Syntax Error - Chatlog
« Reply #10 on: December 22, 2012, 11:20:51 PM »
SELECT * FROM `chatlog` WHERE ....
I've noticed that the SQL files that come with the Windows download do not create a chatlog table which I find interesting.  Only the following tables are created if you run all the scripts:

Code: [Select]
mysql> show tables;
+---------------------+
| Tables_in_tdms2     |
+---------------------+
| aliases             |
| clients             |
| ctime               |
| data                |
| groups              |
| ipaliases           |
| penalties           |
| xlr_actionstats     |
| xlr_bodyparts       |
| xlr_history_monthly |
| xlr_history_weekly  |
| xlr_mapstats        |
| xlr_opponents       |
| xlr_playeractions   |
| xlr_playerbody      |
| xlr_playermaps      |
| xlr_playerstats     |
| xlr_weaponstats     |
| xlr_weaponusage     |
+---------------------+
The frequently used cmdlog and following are not created either.

-Noobtac

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2628
Re: MYSQL Syntax Error - Chatlog
« Reply #11 on: December 23, 2012, 01:16:57 AM »
The chatlog and cmdlog tables are only needed if you use the chatlogger plugin.

 


Rate this page +1 at Google Search

anything