Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/12/2009, 15:08
tirengarfio
 
Fecha de Ingreso: septiembre-2008
Mensajes: 146
Antigüedad: 16 años, 6 meses
Puntos: 1
Error #1064 al hacer una consulta SQL

Hola,

tengo la siguiente consulta SQL:
Código:
SELECT m.id AS m__id, m.usuario_id AS m__usuario_id, m.receptor AS m__receptor, m.tipo AS m__tipo, m.titulo AS m__titulo, m.contenido AS m__contenido, m.estado AS m__estado, m.created_at AS m__created_at, m.updated_at AS m__updated_at FROM mensaje m WHERE m.titulo LIKE ? AND m.created_at >= ? AND m.created_at <= ? AND m.updated_at >= ? AND m.updated_at <= ?', array('%ya%', 'month' => '1', 'day' => '1', 'year' => '2007')
Y me dal el siguiente error:

#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 '? AND m.created_at >= ? AND m.created_at <= ? AND m.updated_at >= ? AND m.update' at line 1

Código:
Field 	Type 	Null 	Default 	Links to 	Comments 	MIME
id 	bigint(20) 	No  	  	  	  	 
usuario_id 	int(11) 	Yes  	NULL  	sf_guard_user -> id  	  	 
receptor 	int(11) 	Yes  	NULL  	  	  	 
tipo 	tinyint(4) 	Yes  	NULL  	  	  	 
titulo 	varchar(100) 	Yes  	NULL  	  	  	 
contenido 	text 	Yes  	NULL  	  	  	 
estado 	tinyint(1) 	Yes  	NULL  	  	  	 
created_at 	datetime 	Yes  	NULL  	  	  	 
updated_at 	datetime 	Yes  	NULL
Alguna idea?

Un saludo

Javi