Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/01/2016, 16:10
Avatar de detective_jd
detective_jd
 
Fecha de Ingreso: abril-2011
Ubicación: Salto
Mensajes: 437
Antigüedad: 13 años
Puntos: 6
Respuesta: Evitar eliminar registros con php

hola x_atrix probé el código del cual me lo diste pero sale este error:

DELETE FROM roles WHERE rolId = ? AND NOT IN (SELECT DISTINCT rolId FROM usuarios) // esto es un echo

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IN (SELECT DISTINCT rolId FROM usuarios)' at line 1

¿porque será? saludos y espero respuestas.