MariaDB/MySQL Connector/C insert is producing confusing error (C++ on Raspbian)

124 Views Asked by At

After some struggling, I was able to get the MariaDB/MySQL libraries linked up to my development environment on the RPi-4B (Raspbian/CodeBlocks).

One of my lines seems to be erroring out and I can't quite figure out why:

insertString = "INSERT INTO eco_tank_data (eco_id) VALUES ('"+eco_id"')";

produces the error:

error: expected ';' before string constant

Am I missing something here? I feel like I'm completely bombing some syntax which is why I just included this line, but can include the full program if necessary.

Thanks

1

There are 1 best solutions below

1
273K On BEST ANSWER

Bonus quiz. Find any operator between eco_id and "')" in eco_id"')".