C ++ program interacting with MySQL database

Does anyone know an easy way for C ++ programs to communicate directly with a MySQL database? I looked at MySQL ++ and found this to be very confusing. If anyone knows a very easy way to do this, please let me know.

thank

PS I am developing on a Windows machine. Setting up web applications PHP and MySQL. C ++ to talk to the serial port. Thus, why do I need C ++ to directly access the MySQL database.

+3
source share
8 answers

There are quite a few database API wrappers, but my favorite — and the one I recommend — is the SOCI library . The syntax is much nicer than using the original C API.

"" SOCI:

int id = ...;
string name;
int salary;

sql << "select name, salary from persons where id = " << id, into(name), into(salary);
+8

MySQL - MySQL Connector ++, . , ++, JDBC- Java. JDBC, . Linux, Windows Mac OS.

0

MySQL ++ . , , MysQL. , , , . .

++, , C. Windows.

0

SQLAPI ++ - SQL Server .

http://www.sqlapi.com/

0

MySQL Connector/++ - JDBC 4.0 ++

, MySQL Connector/++, : - OpenOffice - MySQL Workbench

: http://forums.mysql.com/read.php?167,221298

0

, ++ MySQL?

I would suggest that a C ++ program exchange data with a web server using simple HTTP requests and allow PHP to process the database. Data can be passed to the server-side PHP script through arguments, and data can be returned in XML format.

Writing: your.server.com/add_data.php?table= "info" & data = "0xFCBD ..."

Read: your.server.com/get_data.php?table= "info"

-2
source

Source: https://habr.com/ru/post/1699025/


All Articles