From 011f1d5066808c450c424ef355b9864516ea9854 Mon Sep 17 00:00:00 2001 From: benninghoven Date: Thu, 18 Apr 2024 13:37:13 -0700 Subject: [PATCH] added testing directory --- database/docker-compose.yml | 18 +++-------- .../connect.php | 23 ++++++++++++++ .../index.html | 30 +++++++++++++++++++ 3 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 testing/database_frontend_communication/connect.php create mode 100644 testing/database_frontend_communication/index.html diff --git a/database/docker-compose.yml b/database/docker-compose.yml index 88649ca..8bda106 100644 --- a/database/docker-compose.yml +++ b/database/docker-compose.yml @@ -1,7 +1,8 @@ version: '3.8' services: - db: + database: + container_name: database image: mysql:8 command: --default-authentication-plugin=mysql_native_password restart: always @@ -10,22 +11,11 @@ services: ports: - "3306:3306" volumes: - - mysql_data:/var/lib/mysql - ./init.sql:/docker-entrypoint-initdb.d/init.sql - networks: - - docker-compose-network adminer: + container_name: adminer image: adminer restart: always ports: - - 8081:8080 - networks: - - docker-compose-network - -volumes: - mysql_data: - -networks: - docker-compose-network: - driver: bridge + - 8080:8080 diff --git a/testing/database_frontend_communication/connect.php b/testing/database_frontend_communication/connect.php new file mode 100644 index 0000000..4c4b377 --- /dev/null +++ b/testing/database_frontend_communication/connect.php @@ -0,0 +1,23 @@ +connect_error) { + die("Connection failed: " . $conn->connect_error); +} + +echo "Connected successfully"; + +// Close connection +$conn->close(); + +?> + diff --git a/testing/database_frontend_communication/index.html b/testing/database_frontend_communication/index.html new file mode 100644 index 0000000..bbd02f2 --- /dev/null +++ b/testing/database_frontend_communication/index.html @@ -0,0 +1,30 @@ + + + + + + PHP MySQL Database Connection + + + +

PHP MySQL Database Connection

+ +
+ +

+ + +

+ + +

+ + +

+ + +
+ + + +