diff --git a/server.php b/server.php index ce7d1c9..278325d 100644 --- a/server.php +++ b/server.php @@ -7,6 +7,12 @@ $edit_state=true; //connect to db $db= mysqli_connect('localhost','root','','crud'); + // Check connection + if ($conn->connect_error) { + die("Connection failed: " . $conn->connect_error); + + echo "Connected successfully"; + } //enter into db if(isset($_POST['submit'])) { @@ -44,4 +50,4 @@ //retrive from db $results= mysqli_query($db, "SELECT * FROM information"); -?> \ No newline at end of file +?>