mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-05-28 14:23:11 +00:00
Give an error when connection dies
This commit is contained in:
parent
cb838ad53b
commit
dec15d7b63
4 changed files with 50 additions and 27 deletions
|
@ -1,21 +1,18 @@
|
|||
<?php
|
||||
/*
|
||||
Connect to database
|
||||
Connect to database
|
||||
|
||||
Dunno what else to put here lol
|
||||
Dunno what else to put here lol
|
||||
*/
|
||||
$conn_ip = "192.168.0.79:3306";
|
||||
$conn_username = "uwu";
|
||||
$conn_password = "fennec621";
|
||||
$conn_database = "gallery";
|
||||
try {
|
||||
$conn_ip = "192.168.0.79:3306";
|
||||
$conn_username = "uwu";
|
||||
$conn_password = "fennec621";
|
||||
$conn_database = "gallery";
|
||||
|
||||
$conn = mysqli_connect($conn_ip, $conn_username, $conn_password , $conn_database);
|
||||
if ($conn->connect_error) {
|
||||
?>
|
||||
<script>
|
||||
sniffleAdd('Error','Could not make a connection to the server, please try again later','var(--red)','assets/icons/warning.svg');
|
||||
</script>
|
||||
<?php
|
||||
$conn = @mysqli_connect($conn_ip, $conn_username, $conn_password , $conn_database);
|
||||
} catch (Exception $e) {
|
||||
header("location: error.php?e=conn");
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue