// for variable scope in inner loop executePlainSQL($subStatement); global $verbose; if ($verbose) { echo $subStatement . "<br>"; } OCICommit($db_conn); } if ($verbose) { echo "<br>"; } } } if ($db_conn) { // if connection was successful deleteTables(); createTables(); populateTables(); echo "<hr> Database was reset to default values."; global $verbose; if ($verbose) { echo "To turn off these messages, set {$verbose} to 'FALSE' in reset.php"; } } else { echo "cannot connect"; $e = OCI_Error(); // For OCILogon errors pass no handle echo htmlentities($e['message']); } ?> <br><hr><form><input class="pure-button" type="button" value="Back to Main Menu" onclick="window.location.href='index.php'"><br>
user_id SMALLINT UNSIGNED NOT NULL, PRIMARY KEY(post_id, user_id), FOREIGN KEY(post_id) REFERENCES Posts(post_id), FOREIGN KEY(user_id) REFERENCES Users(user_id) ); '); return $creator[$n_statement]; } #####################Calls methods######################## #Create Mysql object $installer = new MysqlConnector(); #Connect to mysql $installer->connectMysql(); #Uninstall old tables for ($i = 0; $i < 5; $i++) { if ($installer->connection->query(deleteTables($i)) === TRUE) { echo "Deleted <br>"; } else { echo $installer->connection->error . '<br>'; } } #Install new tables for ($i = 0; $i < 5; $i++) { if ($installer->connection->query(addTables($i)) === TRUE) { echo "Created <br>"; } else { echo $installer->connection->error . '<br>'; } } #Disconnect from Mysql $installer->disconnectMysql();