06/12/2012, 17:52
|
| | Fecha de Ingreso: noviembre-2012
Mensajes: 30
Antigüedad: 12 años, 2 meses Puntos: 0 | |
Respuesta: Asignar valor a variable dentro de if gnzsoloyo probe tu query y no funciona
IF (SELECT * FROM `ps_customer` WHERE id_customer = 3) IS NOT NULL THEN
SET @ExistsUser = 1;
END IF;
IF @ExistsUser = 1 THEN
SET @s = 1;
ELSEIF @ExistsUser IS NULL THEN
SET @s = 0;
END IF;
este es el error que marca, bastante generico:
Error
consulta SQL:
IF( SELECT *
FROM `ps_customer`
WHERE id_customer =3 ) IS NOT NULL
THEN
SET @ExistsUser =1;
MySQL ha dicho:
#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 'IF (SELECT * FROM `ps_customer` WHERE id_customer = 3) IS NOT NULL THEN
SE' at line 1 |