How do I display a Dialog when the script occurs correctly?
public function addDatabase($name, $collation) {
// Checks whether all fields filled (Prevent future errors)
if (!empty($name) AND !empty($collation)) {
try {
// If you want to change (Don't forget the ;)
// http://dev.mysql.com/doc/refman/5.6/en/create-database.html
$sql_query = 'CREATE DATABASE ''.$name.'' COLLATE ''.$collation.'';';
// Prepare the query to execute
$query = $this->db->prepare($sql_query);
// Execute the query
$query->execute();
} catch (PDOException $e) {
exit ('DB ERROR: '. $e->getMessage());
}
} else {
if (empty($name)) {
echo '$name está vazio';
}
if (empty($collation)) {
echo '$collation está vazio';
}
}
}
CSS / JS dialog: link