Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once 'practice3.php'; //add the path of the file containing database connection code
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Exam Practice 1</title>
- </head>
- <body>
- Hello World<br>
- <?php
- // database connection check
- if($conn){
- echo "Database connected";
- }
- else{
- echo "Connection Error";
- }
- ?>
- </body>
- </html>
- <!-- put this code into another file -->
- <?php
- // database connection code
- $dbServerName="localhost";
- $dbUserName="root";
- $dbPassword= "";
- $dbName="test3";
- $conn=mysqli_connect($dbServerName,$dbUserName,$dbPassword,$dbName);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement