Hi guys,
I have a small issue, but I don't get any error messages. I'm trying to run a loop that inserts data if a criteria is true. But when I run it, nothing happens. All i get is a freeze of sorts. Everything works fine without the insertion loop.
The code:
if ($dbconnector = @mysql_connect($dbhost, $dbusername, $dbpassword) && $dbhost !=="" && $dbselector = @mysql_select_db($dbname)) {
mkdir('bandfiles', 0755) OR die('<h3 class="warning">Failure: failed making "bandfiles" directory. Check the permissions on your installation server.</h3>');
mkdir('bandfiles/prod_pics', 0755) OR die('<h3 class="warning">Failure: failed making "pics" directory. Check the permissions on your installation server.</h3>');
mkdir('bandfiles/media_samples', 0755) OR die('<h3 class="warning">Failure: failed making "media samples" directory. Check the permissions on your installation server.</h3>');
mkdir('bandfiles/media_files', 0755) OR die('<h3 class="warning">Failure: failed making "media_files" directory. Check the permissions on your installation server.</h3>');
//
// Inserting valid values for future reference.
//
$query[] = "INSERT INTO parameter VALUES(1, 'dbname', '$dbname')";
$query[] = "INSERT INTO parameter VALUES(2, 'dbhost', '$dbhost')";
$query[] = "INSERT INTO parameter VALUES(3, 'admin', 'admin')";
for ($nr=0;$nr<3;$nr++){
mysql_query($query[$nr]) OR die('<h3 class="warning">Error processing query $nr: . mysql_error())</h3>';
}
die('<h3 class="success">Success: Your parameters checked out, and have been permanently stored for future reference. The needed folders have also been created in your webdirectory along with a siteuser. Please remove this file (setup.php) from your webdirectory, as it\'s not safe to leave it on your server.</h3>');
}
else die('<h3 class="warning">Connecting using your supplied database parameters failed, so your connection info was not saved and the application folders not created. Go back and re-check your entered values, and try again.<h3>');
As far as I can see, the loop should just run after the last folder has been created and the whole process die with the success message, if no hickups occur. Why does this not work as intended?
Bye,