Hello,
I have one script that I would like to call up 21 times (at once) as soon as the script terminates (naturally) the parent script should invoke another instance of the child script so that 21 scripts are constantly running at the same time...
The point of this is to work off a constantly growing database with a certain procedure... and because of the mass entries into the database there needs to be more than one process running to handle the load...
I tried it with a popen(), but for some reason the parent script only opens one instance of the child script... here my script (db info has been taken out):
while (mysql_result(mysql_query("SELECT count(nr) AS needy FROM Clients WHERE done = '0'"),0,"needy") != 0) {
// Check if Processes are possible
if (mysql_result(mysql_query("SELECT count(nr) AS num_proc FROM control"),0,"num_proc") < 21) {
echo "Starting Process!";
popen("/usr/local/bin/php post.client.php","r");
}
} // END While Client "needy"
Thanks Joseph