diff --git a/connect_db.php b/connect_db.php index b24967e..7643de4 100644 --- a/connect_db.php +++ b/connect_db.php @@ -1,17 +1,15 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - echo "Connected successfully"; - } catch(PDOException $e) { - echo "Connection failed: " . $e->getMessage(); - } - - + if(!$db_link){ + die("
Verbindung nicht hergestellt
"); + }else{ + echo "Verbindung hergestellt!"; + } + + function runSQL($sql){ + global $db_link; + $db_res = mysqli_query($db_link, $sql) or die("SQL_Abfrage: " . $sql . "Fehler: " . mysqli_error($db_link)); + return $db_res; + } ?> \ No newline at end of file