FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


using system()





eudbase
Hi, may I know that how can I perform the system call to run an application background? For example, I want to run mySQL console using system() but each time when I just start the mysql console... the system call will end before I input any SQL command. How can I hold the application, I mean holding the cursor in MySQL console instead of letting it going back to DOS cmd?

Is it possible to control the external programs using system() only by sending input directly into the MySQL console bypassing DOS cmd? How to send multiple line commands?

I am using windows OS.
pollux1er
The system() function is useful when you want to output the executed command’s
results. Its prototype follows:
Code:
string system(string command [, int return_var])


Rather than return output via an optional parameter, as is the case with exec(), the
output is returned directly to the caller. However, if you would like to review the execution
status of the called program, you need to designate a variable using the optional
parameter return_var.
For example, suppose you’d like to list all files located within a specific directory:
Code:
$mymp3s = system("ls -1 /home/jason/mp3s/");


The following example calls the aforementioned languages.pl script, this time
using system():

Code:
<?php
$outcome = system("languages.pl", $results);
echo $outcome
?>
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.