1064 error with mysql_query, but it works with Mysql Workbench
Posted by:
ross guecel ()
Date: December 19, 2012 06:45PM
Hello, I have no problem to execute the query well (I can see the rows), but in a C/C++ application code it throws this error at runtime.
This is the code:
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()))
{
// throw error and quit
// ..................
}
The query is as follows:
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';
Date format is yyyy-mm-dd
Ubuntu 12.04
MySQL Server 5.5.24.
I appreciate any suggestions, cheers!