tengo el siguiente problema: No me realiza correctamente el NOT IN del where, probe cambiar las comillas varias veces, utilizar las \ , intenté tambien (:permisosID) pero no hay caso. Sin bindear el :permisosID y poniendo NOT IN $permisosFiltro funciona.. pero no es lo ideal. Algo estoy haciendo mal y no puedo verlo.
El error es claro.. Syntax error or access violation: 1064 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 ''(12,11,10,9,8,7,6,5,4,3,2,1)' AND P.ID_ESTADO <> 3\r\n ORDER BY 1 DESC'
$permisosFiltro = 1,2,3,4,5,6;
$query = "SELECT
P.ID_PERMISO,
P.NOMBRE,
P.DESCRIPCION,
P.ID_ESTADO
FROM ".$this->_schema.".PERMISOS P
WHERE P.ID_PERMISO NOT IN :permisosID AND P.ID_ESTADO <> 3
ORDER BY 1 DESC";
$result = $this->_db->prepare($query);
$result->bindValue(":permisosID", "(" . $permisosFiltro . ")");
´´´