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 '(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') AS playerLastUpdat
SQL:
SELECT members.name , ISNULL(players.name) AS playerExists , STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') AS playerLastUpdated FROM `roster_members` members LEFT JOIN `roster_players` players ON members.name = players.name WHERE members.level >= 10 AND ( ISNULL(players.name) OR STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') <= DATE_SUB(NOW(), INTERVAL 24 HOUR) OR STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') >= DATE_ADD(NOW(), INTERVAL 1 YEAR) ) ORDER BY members.last_online DESC
File: index.php
Line: 42
Backtrace (most recent call last):
* File: /mnt/web6/10/00/51402500/htdocs/fosdomination/roster/lib/commonfunctions.lib.php
o line 248
o function called: backtrace
* File: /mnt/web6/10/00/51402500/htdocs/fosdomination/roster/addons/ArmorySynch/index.php
o line 42
o function called: die_quietly
o args: 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 '(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') AS playerLastUpdat, Database Error, index.php, 42, SELECT members.name , ISNULL(players.name) AS playerExists , STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') AS playerLastUpdated FROM `roster_members` members LEFT JOIN `roster_players` players ON members.name = players.name WHERE members.level >= 10 AND ( ISNULL(players.name) OR STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') <= DATE_SUB(NOW(), INTERVAL 24 HOUR) OR STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') >= DATE_ADD(NOW(), INTERVAL 1 YEAR) ) ORDER BY members.last_online DESC
* File: /mnt/web6/10/00/51402500/htdocs/fosdomination/roster/addon.php
o line 77
o function called: include_once
o args: /mnt/web6/10/00/51402500/htdocs/fosdomination/roster/addons/ArmorySynch/index.php
That is what sql error its giving, and im new to php coding so i cant make anything out of this except that the problem appears to be in index.php of the addon. This is the code where i think the problem is.
$query =
"SELECT members.name " .
", ISNULL(players.name) AS playerExists " .
", STR_TO_DATE(players.dateupdatedutc,'". $addon_conf['ArmorySync']['DateUpdatedFormat'] ."') AS playerLastUpdated " .
"FROM `".ROSTER_MEMBERSTABLE."` members " .
"LEFT JOIN `".ROSTER_PLAYERSTABLE."` players " .
"ON members.name = players.name " .
"WHERE members.level >= " . $addon_conf['ArmorySync']['MinLevel'] . " " .
"AND ( ".
"ISNULL(players.name) " .
"OR STR_TO_DATE(players.dateupdatedutc,'". $addon_conf['ArmorySync']['DateUpdatedFormat'] ."') <= DATE_SUB(NOW(), INTERVAL " . $addon_conf['ArmorySync']['SynchCutoffTime'] . " HOUR) " .
"OR STR_TO_DATE(players.dateupdatedutc,'". $addon_conf['ArmorySync']['DateUpdatedFormat'] ."') >= DATE_ADD(NOW(), INTERVAL 1 YEAR) " .
") " .
"ORDER BY " . $addon_conf['ArmorySync']['MemberSorting'];
if ($addon_conf['ArmorySync']['DebugLevel'] >= 1) {
print $query . "<br>";
}
But as i said im new to php coding, here is the config text.
<?php
if (!defined('ROSTER_INSTALLED')) {
exit('Detected invalid access to this file!');
}
//Configuration
$addon_conf['ArmorySync']['Host'] = "armory.worldofwarcraft.com"; //European players use: armory.wow-europe.com
$addon_conf['ArmorySync']['MinLevel'] = 10; //The minimum level to be updated
$addon_conf['ArmorySync']['SynchCutoffTime'] = 24; //Time, in hours. All players who have not updated in the last (24) hours will be updated.
$addon_conf['ArmorySync']['UseCurl'] = true; //Set this to false if you want to use the original FileSocket function.
$addon_conf['ArmorySync']['DebugLevel'] = 0; //0 = no debug messages, 1 = some debug messages, 2 = verbose debug messages
$addon_conf['ArmorySync']['UpdateRoster'] = true; //Wether or not to update Roster. Useful if you're just debugging.
$addon_conf['ArmorySync']['Locale'] = $roster_conf['roster_lang']; //The language used, but default it is the language that roster is configured to.
$addon_conf['ArmorySync']['ArmoryLocale'] = strtolower(substr($addon_conf['ArmorySync']['Locale'], 0, 2)) . "_" . strtolower(substr($addon_conf['ArmorySync']['Locale'], 2, 2)); //The Locale that armory is expecting, in the format of lowercase_lowercase (ie en_us or de_de).
$addon_conf['ArmorySync']['MemberSorting'] = ""members.update_time DESC"; //alternatives are "members.update_time DESC" to use the last time the member was updated
$addon_conf['ArmorySync']['ServerMonth'] = array("January","February","March","April","May","June","July","August","September","October","November","December"); //just a list of the month names for the server. Change this to whatever language necessary.
$addon_conf['ArmorySync']['DateUpdatedFormat'] = "%m/%d/%y %h:%i:%s"; //Europeans change this to "%d/%m/%y %H:%i:%s"
?>
tell me what else you need and ill post it any help would be arreciated.
This is for a EU server by the way.
Thanks Exilus