Dear. everybody.

when i progress the developing some functions using mysql db with vc++2005, i have the following problems

i connected mysqldb and i runned the query to insert some records to my table in the DB, but i cant success in inserting.

my sample code is followed as :

char sqlString[1024];
   sprintf(sqlString,"INSERT INTO myTable('StaffID','Name','Birthday','PhotoURL') VALUES('%d','%s','%s','%s')",'3',"playboy","10-19-2009","c:/myphoto.jpg");
   int m_Query_State = mysql_query(m_pConnection, sqlString);
   if (m_Query_State != 0)
   {
      fprintf(stderr, "Mysql query error : %s", mysql_error(&m_Conn));
      return ;
   }

when i run this statement , m_Query_State Value =1. so the run of the code was failed.

how can i solve this problem?
if someone experienced the connectivity mysqldb with vc++2005, please kindly teach me.

i'll really appreciate if you help me.

column names of the table should not be enclosed in quotes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.