Unanswered: Executing command line stuff from a Web App
I have a book which gives various tips regarding MySQL some of which include issuing queries from the command prompt.
%mysql -X -e "select * from myTable" myDatabase
This query for instance outputs a result as XML rather than in table format.
My question is how would I use something like this, a query that is designed for executing via the command prompt, from a Web Application?
Someone in another forum suggested using the system() function but I am unable to find any mention of this function on any MySQL related websites.
The sorts of things that may be useful to be able to execute from a web page are instructions like:
%mysqldump myDatabase states > dump.txt
This might enable me to click a button in a web page and execute the instruction.
my first question would be what you are writing your web application in? Most server-side programming gives you the ability to execute command line utilities/programs...For instance, PHP has the 'exec()' and 'shell_exec()' functions...Perl has it's own and I'm sure ASP, JSP, etc all have their own. You would not find this documentation in MySQL rather the web programming language you chose to write your web application.
The above being said, many of the mysql functions are built in directly in native functions of that programming language for connectiong/disconnection, selecting dbs, writing/executing queries....Here is the PHP documentation, but again, this depends on what you chose to write your web application in....http://www.php.net/manual/en/ref.mysql.php