Skip to content

Commit

Permalink
hw1
Browse files Browse the repository at this point in the history
  • Loading branch information
levitanoff committed Dec 1, 2023
1 parent 8e2bca5 commit ee5b6dc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions code/app/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
// Test MySQL (Docker)
$mysqli_connection = new MySQLi('db', 'docker', 'secret', 'test');

if ($mysqli_connection->connect_error) echo "MySQL Not connected, error: " . $mysqli_connection->connect_error;
else echo "MySQL Connected to Docker container.<br><br>";
if ($mysqli_connection->connect_error) {
echo "MySQL Not connected, error: " . $mysqli_connection->connect_error;
} else {
echo "MySQL Connected to Docker container.<br><br>";
}

// Test MySQL (Homestead)
$mysqli_homestead_connection = new MySQLi('192.168.56.56', 'homestead', 'secret', 'homestead', 3306);

if ($mysqli_homestead_connection->connect_error) echo "MySQL Connected to Homestead";
else echo "MySQL Not connected to Homestead, error: " . $mysqli_homestead_connection->connect_error;
if ($mysqli_homestead_connection->connect_error) {
echo "MySQL Connected to Homestead";
} else {
echo "MySQL Not connected to Homestead, error: " . $mysqli_homestead_connection->connect_error;
}

phpinfo();

0 comments on commit ee5b6dc

Please sign in to comment.