DBException

Database error: 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 'AND _lang=2 AND type='file'' at line 1

3
			
#0 | #1 | #3 | #4 | #5

File: app/models/release.php

20: 'photos' => array(
21: 'model_name' => 'File',
22: 'table_name' => 'files',
23: 'foreign_key' => 'release_id',
24: 'where' => '`type`=\'photo\''
25: )
26: );
27: function getFiles(){
28: $q = "SELECT * FROM files WHERE release_id = ".$this->_id." AND _lang=".$this->_lang." AND type='file'";
29: $result = $this->conn->query($q);
30: while ($row = $result->fetch_assoc()){
31: $res[] = $row;
32: }
33: return $res;
34: }
35: function getPhotos(){
36: $q = "SELECT * FROM files WHERE release_id = ".$this->_id." AND _lang=".$this->_lang." AND type='photo'";
37: $result = $this->conn->query($q);
38: while ($row = $result->fetch_assoc()){
39: $res[] = $row;

This error is brought to you by Stitch-1.0

"640K ought to be enough for anybody." - Bill Gates, 1981