I am creating a c++ program using SQL statements to write string variables (powname,frecchan,pownumber) into a Mysql data base this is my code:
if (mysql_query(con, "INSERT INTO log(ip, outlet, action)" << "VALUES (\"\",\"" << powname << "\",\"" << frecchan << "\",\"" << pownumber << "\" )"))
I get the following errors when compiling with gcc:
mysqlled.cpp:222: error: invalid operands of types ‘const char ’ and ‘const char ’ to binary ‘operator<<’
I know the mysql_query and INSERT INTO works because when I use values instead of varibles it works find and ofcourse I do not have to use the scape sequences.
Can anyone help me out I do not know what else to do.
Thank you so much
1 Replies - 1263 Views - Last Post: 04 February 2014 - 09:34 AM
Replies To: Using variables instead of values at INSER TO (name,age)Value(var,var2
Page 1 of 1