I have a PHP file that executes multiple sql scripts. I find that the first two scripts execute, but the last two never seem to complete. I tested the last two scripts individually in their own PHP files and the scripts worked, so I'm wondering if it's because of the number of exec() calls I'm making in my PHP script. Any suggestions? Here's the original script:
<?php
session_start();
$host = "localhost";
$user = "user";
$pass = "pass";
$database = "database";
$linkID = mysql_connect($host, $user, $pass) or die("Could not connect to host.");
mysql_select_db($database, $linkID) or die("Could not find database.");
$query = sprintf("SELECT dbName FROM users where userName='%s'",
$_SESSION['MM_Username']);
$resultID = mysql_query($query) or die("Data not found.");
list($dbName)= mysql_fetch_row($resultID);
exec("mysql -u user -ppassword ".$dbName." < ../scripts/makeTblFinalAnalysis.sql");
exec("mysql -u user -ppassword ".$dbName." < ../scripts/tblFinalDetailed.sql");
exec("mysql -u user -ppassword ".$dbName." < ../scripts/TblGridViews.sql");
exec("mysql -u user -ppassword ".$dbName." < ../scripts/makeTblGeo.sql");
header( 'Location: dashboards/dashboard.html' ) ;
exit;
?>