Exemplo n.º 1
0
             }
         } else {
             echo '<p class="error">Could not write to config file! ' . $POD->error() . "</p>";
             $error = true;
         }
         if (!$error) {
             echo '<p><a href="index.php">Continue &#187;</a></p>';
         }
     }
 } else {
     if ($POD->errorCode() == 101) {
         echo "<p><b>Step 2: Connect to the Database</b></p>";
         echo "<p>Now I need to figure out how to connect to the MySQL database you created for me.</p>";
         echo "<hr />";
         if (@$_POST['mysql_server'] && @$_POST['mysql_db'] && @$_POST['mysql_user'] && @$_POST['mysql_pass']) {
             $newDb = $POD->connectToDatabase($_POST['mysql_server'], $_POST['mysql_user'], $_POST['mysql_pass'], $_POST['mysql_db']);
             if ($newDb) {
                 $POD->setLibOptions('mysql_server', $_POST['mysql_server']);
                 $POD->setLibOptions('mysql_db', $_POST['mysql_db']);
                 $POD->setLibOptions('mysql_user', $_POST['mysql_user']);
                 $POD->setLibOptions('mysql_pass', $_POST['mysql_pass']);
                 $POD->saveLibOptions(true);
                 if ($POD->success()) {
                     echo '<p>Database options saved!</p>';
                     echo '<p>Creating Database...</p>';
                     // here is all the juicy SQL that creates the PeoplePods tables.
                     include "SQL.php";
                     foreach ($tables as $table => $sql) {
                         $test = "SELECT count(1) FROM {$table}";
                         $res = mysql_query($test, $newDb);
                         if ($res) {