Hello, this is the code I'm using:
self::$DB->prepare($query, $types);
when the $query and types are:
//$query
UPDATE Permisos
SET
empleado_id = ?,
agregar_mensaje = ?,
borrar_mensaje = ?,
agregar_noticia = ?,
borrar_noticia = ?,
agregar_documento = ?,
borrar_documento = ?,
agregar_usuario = ?,
borrar_usuario = ?,
agregar_empresa = ?,
borrar_empresa = ?,
agregar_tarea = ?
WHERE
id = ?
//$types
Array(
[0] => integer
[1] => boolean
[2] => boolean
[3] => boolean
[4] => boolean
[5] => boolean
[6] => boolean
[7] => boolean
[8] => boolean
[9] => boolean
[10] => boolean
[11] => boolean
[12] => integer
)
Everything works great, but when they are:
//$query
UPDATE Permisos SET
empleado_id = ?,
agregar_mensaje = ?,
borrar_mensaje = ?,
agregar_noticia = ?,
borrar_noticia = ?,
agregar_documento = ?,
borrar_documento = ?,
agregar_usuario = ?,
borrar_usuario = ?,
agregar_empresa = ?,
borrar_empresa = ?,
agregar_tarea = ?,
borrar_tarea = ?
WHERE
id = ?
//$types
Array(
[0] => integer
[1] => boolean
[2] => boolean
[3] => boolean
[4] => boolean
[5] => boolean
[6] => boolean
[7] => boolean
[8] => boolean
[9] => boolean
[10] => boolean
[11] => boolean
[12] => boolean
[13] => integer
)
It fails with the following message:
<b>Warning</b>: PDO::prepare() [<a href='pdo.prepare'>pdo.prepare</a>]: SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); the classname must be a string specifying an existing class in <b>C:\wamp\www\intratin\JP\includes\empleado\mapper\Permiso.php</b> on line <b>137</b><br />
Doesn't matter which field I add or remove, it fails every time with more than 13 placeholders.