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!

Options: ReplyQuote


Subject
Views
Written By
Posted
1064 error with mysql_query, but it works with Mysql Workbench
2512
December 19, 2012 06:45PM


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.