Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Page Title</title>
- <style>
- ul {
- list-style-type: none; /*Removes the bullet points*/
- margin: 0;
- padding: 0;
- overflow: hidden; /*Pushes the text to the next line*/
- background-color: gray;
- }
- li {
- float: left; /*Gets the list horizontal*/
- }
- li a {
- display: block;
- color: Black;
- text-align: center;
- padding: 14px 16px;
- text-decoration: none;
- }
- li a:hover {
- background-color: firebrick;
- }
- </style>
- </head>
- <body>
- <h1>Home</h1>
- <ul>
- <li><a href="http://localhost/DBI_CW_Home.php"> Home </a></li>
- <li><a href="http://localhost/DBI_CW_Artist.php"> Artist </a></li>
- <li><a href="http://localhost/DBI_CW_Albums.php"> Albums </a></li>
- <li><a href="http://localhost/DBI_CW_Tracks.php"> Tracks </a></li>
- </ul>
- <p>GB5DBI Example Assingment for Psymc3</p>
- <h1>Database demo #1: create database connection</h1>
- <?php
- $servername = "localhost";
- $username = "psymc3@localhost";
- $password = "BKGYEE";
- $dbname = "psymc3";
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Create a database connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if(mysqli_connect_errno())
- {
- echo "Failed to connect to MySQL: ".mysqli_connect_error();
- die();
- }
- else echo "MySQL connection OK<br>"; // useful for testing
- // Close database connection
- mysqli_close($conn);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement