If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Executing command line stuff from a Web App

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-21-04, 11:49
chris_gilbert chris_gilbert is offline
Registered User
 
Join Date: Jun 2004
Posts: 5
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.

Any help is appreciated.

Chris
Reply With Quote
  #2 (permalink)  
Old 06-22-04, 15:41
DrSmartman DrSmartman is offline
Registered User
 
Join Date: Aug 2003
Location: Reston, VA
Posts: 59
Command Line...

hello...

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

Happy Trails!
Reply With Quote
  #3 (permalink)  
Old 06-23-04, 05:05
chris_gilbert chris_gilbert is offline
Registered User
 
Join Date: Jun 2004
Posts: 5
Thanks for your reply. I'm writing it in ASP so if anyone else has any experience in this sort of thing using ASP i'd appreciate any help available.

Thanks in advance

Chris
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On