如何以快速方式从多个目录中运行相同的php文件?

In my books folder , there are nearly 200 book folder like :

--books (folder)  
  |--book1(folder)
  |--book2(folder)
  |--(this continues until 200)  

What I want is that I need to create some directories inside 200 folder by fetching data from mysql about folder. I can make it manually but making one by one is very inefficient.

I coded create_folder.php and insert it book1 folder to see how it give a result :

$current_folder = basename(dirname(__FILE__));

// I choose which directories are inserted.
$sql = "SELECT directory FROM ..............WHERE folder = {$current_folder} ";

$result = mysql_query($sql);

while ($row = mysql_fetch_array($result)) {
  mkdir($row['directory']);
}  

So, in my book1 folder, I created directories via database.
After that, I created glob.php file in order to insert create_folder.php in all 200 directories automaticly.(I put glob.php in main books folder. Here :

$content = file_get_contents("create_folder.php");

$files = glob( './*' );
foreach( $files as $file ) {
if( is_dir( $file ) && is_writable( $file ) ) {
    file_put_contents( $file . '/create_folder.php', $content );
    }
}

Now, inside 200 folders, there is create_folder.php. The problem is, I must make create_folder.php run in all 200 directories in order to create sub directories. Any quick way to run it? Thanks...

$files = glob( './*' );
foreach( $files as $file ) {
if( is_dir( $file ) && is_writable( $file ) ) {
$output = exec('php -l '.$file.'/create_folder.php',$function_output,$return);
print $output."
";
print $return."
";
var_dump($function_output);
    }
}

Run this in your root directory. SO if your sites are in /home/user/site1, /home/user/site2, then run it from /home/user.