Тема: 1064 ошибка
Ошибка:
MySQL error in file: /engine/modules/files/newfiles.php at line 14
Error Number: 1064
The Error returned was:
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 '' at line 5
SQL query:
SELECT `id`, `title`, `version`, `alt_name` FROM `dle_` WHERE `approve` = '0' AND `date` < '2014-08-28 13:41:39' ORDER BY `date` DESC ,
Код:
<?php
if (!defined ( 'DATALIFEENGINE'))
die ( "Hacking attempt!");
include ENGINE_DIR .'/data/'.$files .'_config_global.php';
$newfiles = dle_cache ( "new".$modulname );
if (!$newfiles) {
$thisdate = date ( "Y-m-d H:i:s",(time () +($config ['date_adjust'] * 60)) );
include_once ENGINE_DIR .'/data/'.$modulname .'_config.php';
$db->query ( "SELECT `id`,
`title`,
`version`,
`alt_name`
FROM `".PREFIX ."_".$module_dbtitle."` WHERE `approve` = '0' AND `date` < '{$thisdate}' ORDER BY `date` DESC ,".$filesConfig ['numbernewfiles'] ."");
while ( $row = $db->get_row () ) {
if (strlen ( $row ['title'] ) >25)
$title = substr ( $row ['title'],0,25 ) ." ...";
else
$title = $row ['title'];
$ctitle = $row ['id'];
if ($config ['allow_alt_url'] == "yes") {
if ($filesConfig ['nica_rewrite'] == "1")
$linkfile = "<a class=\"newfiles\" title=\"".stripslashes ( $row ['title'] ) ." ".$row ['version'] ."\" href=\"".$config ['http_home_url'] .$modulname ."/".$row ['id'] ."_".$row ['alt_name'] .".html\">".stripslashes ( $title ) ." ".$row ['version'] ."</a>";
else
$linkfile = "<a class=\"newfiles\" title=\"".stripslashes ( $row ['title'] ) ." ".$row ['version'] ."\" href=\"".$config ['http_home_url'] .$modulname ."/file".$row ['id'] .".html\">".stripslashes ( $title ) ." ".$row ['version'] ."</a>";
}else
$linkfile = "<a class=\"newfiles\" title=\"".stripslashes ( $row ['title'] ) ." ".$row ['version'] ."\" href=\"".$config ['http_home_url'] ."index.php?do=".$modulname ."&op=download&fileid=".$row ['id'] ."\">".stripslashes ( $title ) ." ".$row ['version'] ."</a>";
$newfiles .= "» ".$linkfile ."<br />";
}
$db->free ();
create_cache ( "new".$modulname,$newfiles );
}
?>
Как исправить?