1

I would like to know how do I copy column from one table to another another table using mysql database connection?

My code is like this:

string insert_query = "insert into customer_info (Customer Name, Price) Select name,price from medicine_tb where id = '"+storeid[j]+"'"; 

const char* qu = insert_query.c_str();
qstate = mysql_query(conn, qu);

But it is NOT working!

GMB
  • 216,147
  • 25
  • 84
  • 135
Habeeb E Sadeed
  • 119
  • 1
  • 2
  • 7
  • What's the error message? "It is NOT working" is not really helpful. – csabinho Oct 10 '19 at 22:31
  • Possible duplicate of [Is MySQL Connector C++ cgi program vulnerable to MySQL injection just like php is?](https://stackoverflow.com/questions/30431877/is-mysql-connector-c-cgi-program-vulnerable-to-mysql-injection-just-like-php-i) – Uyghur Lives Matter Oct 11 '19 at 04:08

1 Answers1

0

Please use

insert into customer_info (`Customer Name`, Price) 
nbk
  • 45,398
  • 8
  • 30
  • 47