MySQL Forums
Forum List  »  Spanish

error 1064 en código con mysql_query, pero no con Mysql Workbench
Posted by: ross guecel
Date: December 19, 2012 06:40PM

Hola, cuando ejecuto la sentencia en el MySql Workbench funciona perfectamente, pero si lo hago por medio de código, da error.

Esta es la parte del código:

query << "SELECT Nom_Pelic, Path, Dur_Hora, DUR_Minutos, DUR_Segundos, HH,MM,SS FROM PELICULAS,PROGRAMACION WHERE PELICULA.Cod_ID = PROGRAMACION.Cod_ID AND PROGRAMACION.Fecha = " << "'" << fecha << "'";

if (mysql_query(&conn,query.str().c_str()))
{

// hubo error
// ..................
}

El contenido de la sentencia es:

SELECT Nom_Pelic, Path, Dur_Hora, DUR_Minutos, DUR_Segundos, HH,MM,SS FROM PELICULAS,PROGRAMACION WHERE PELICULA.Cod_ID = PROGRAMACION.Cod_ID AND PROGRAMACION.Fecha = '2012-10-11';

Fecha con formato yyyy-mm-dd
Ubuntu 12.04
MySQL Server 5.5.24.


Les agradezco alguna sugerencia, saludos!

Options: ReplyQuote


Subject
Views
Written By
Posted
error 1064 en código con mysql_query, pero no con Mysql Workbench
2067
December 19, 2012 06:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.