Le falta el rolId despues del AND
Código PHP:
public function eliminame($rol, $notUsed = true) {
$sql = "DELETE FROM roles WHERE rolId = ?";
if ($notUsed === true) {
$sql .= ' AND rolId NOT IN (SELECT DISTINCT rolId FROM usuarios)';
}
$consulta = $this->getBD()->prepare($sql);
$consulta->execute(array($rol->getId()));
return ($consulta->rowCount() > 0) ? $rol->getId() : null;
}
Un saludo,