-1
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 12:57:32' ORDER BY `date` DESC LIMIT 0,

code fragment:

 $db->query ( "SELECT `id`,
 `title`,
 `version`, 
 `alt_name`
 FROM `".PREFIX ."_".$modul_dbtitle ."` WHERE `approve` = '0' AND `date` < '{$thisdate}'  ORDER BY `date` DESC LIMIT 0,".$filesConfig ['numbernewfiles'] ."");
John Conde
  • 217,595
  • 99
  • 455
  • 496
  • Please do *not* use tags that do not apply to your question – John Conde Aug 28 '14 at 13:10
  • LIMIT 0 is meaningless remove it – Mihai Aug 28 '14 at 13:12
  • Make sure that the `numbernewfiles` column is an `int` and that there is indeed a value being passed through `$filesConfig`. Plus, if your column's name is indeed `numbernewfiles` and not `Numbernewfiles` - Add error reporting to the top of your file(s) `error_reporting(E_ALL); ini_set('display_errors', 1);` – Funk Forty Niner Aug 28 '14 at 13:31

2 Answers2

1

$modul_dbtitle apparently does not have a value as your tablename is incomplete in your query.

SELECT `id`, `title`, `version`, `alt_name` FROM `dle_` WHERE `approve` = '
                                                  ^^^^^^
                                                   HERE

You need to figure out why. My guess is you are missing an e in the variable name:

$modul_dbtitle

should be

$module_dbtitle

Additionally, $filesConfig ['numbernewfiles'] also contains no value and will break your query.

You should ensure error reporting is turned on as I suspect PHP would be warning you about these errors.

Community
  • 1
  • 1
John Conde
  • 217,595
  • 99
  • 455
  • 496
0

There is missing the number of line in your statement:

LIMIT 0,".$filesConfig ['numbernewfiles']

DESC LIMIT 0,
           ^^^^^

Looks like $filesConfig ['numbernewfiles'] is blank

Jens
  • 67,715
  • 15
  • 98
  • 113