cgi scripts

Started by
4 comments, last by SaraSweet 20 years ago
if cgi scripts, such as a PHP script, are used to enable programs to communicate with each other, how does, say, a MySQL database communicate with a C++ program across a network?
Advertisement
It''s the other way around. A MySQL db is a server. A client written in C++ (or whatever) connects across the network to the server to run queries.
Using....? how does a client access the server with SQL queries? Text strings? :

string* str = "SELECT * FROM MyDatabase";
query_mysql(str);

How would the query_mysql() function work? This is what I really meant to be asking, I just didn''t word it properly. Sorry!
ODBC

Your client app, be it asp/.net, php, C++, VB etc connects to the ODBC driver, the ODBC driver connects to a local or remote DB. Most ODBC drivers give ANSI-92 functionality plus a number or proprietary commands. EG. MS SQL ODBC driver connects to remote server over a couple of TCP/IP ports. You just need to communicate with the ODBC driver and let it worry about all the other stuff.

(I think Java uses similar JDBC, but not my area of expertise.)

Jay
In addition to the ODBC driver, there is also a C++ API called MySQL++. See manual here.
quote:Original post by Jason Zelos
I think Java uses similar JDBC, but not my area of expertise.


Correct. I''ve used it a few times, and it''s quite similar.

Grant Palin
Grant Palin

This topic is closed to new replies.

Advertisement