Ver Mensaje Individual
  #9 (permalink)  
Antiguo 25/11/2013, 11:54
Avatar de NSD
NSD
Colaborador
 
Fecha de Ingreso: mayo-2012
Ubicación: Somewhere
Mensajes: 1.332
Antigüedad: 12 años
Puntos: 320
Respuesta: Error Mysqli sentencia preparada con un if simple

Código PHP:
Ver original
  1. $sentencia = "  SELECT if(articulos.stock>0,'si','no') AS existeStock FROM articulos;";
  2.            
  3.         $this->resultados = $this->rawQuery($sentencia, $bindParametros);


Cita:
Ocurrio un error preparando la sentencia ( SELECT if(articulos.stock>0,'si','no') AS existeStock FROM articulos;) 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 ''si','no') AS existeStock FROM articulos' at line 1
__________________
Maratón de desafíos PHP Junio - Agosto 2015 en FDW | Reglamento - Desafios