Programming help: C++, PHP, MYSQL & AGS

Started by Calin Leafshade, Tue 13/07/2010 09:41:11

Previous topic - Next topic

Calin Leafshade

So i've recently started looking into the AGS plugin API and i have a question on the best way to do this..

Basically I want AGS to run a MYSQL command on a server.

So I have 2 thoughts..

a) use the MYSQL++ library to run the command directly through ags.

b) pass the variables to a php script and let the webserver do the work.

obviously option b would be better and simpler but is it possible to get a c++ program to send a php request to a server silently?

Edit: On further searching it seems libcurl could be used for what i want right?

help me?

Wyz

#1
On first impression option (a) sounds like a really neat thing to do, but there is a problem with the way MySQL servers are usually set up.
Traditional there is a central server and a bunch of clients that connect to it, mostly by web-servers. Because these run usually on the same subnet SQL servers are generally configured only to accept local requests. This is actually also a lot safer then allowing client to interact with the SQL server directly. You can do a lot of extra checks with server-side scripts: for instance only allow certain tables/fields to be changed by clients. In that case option (b) sound like a better idea, and for web-requests libcurl is perfect.
Life is like an adventure without the pixel hunts.

SMF spam blocked by CleanTalk