<?php require 'db_connection_milly.php'; ?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <title>MySQL Quotes.</title>
      <link href="https://fonts.googleapis.com/css?family=Karla|Roboto+Mono" rel="stylesheet">
      <link rel="stylesheet" href="style.css" media="screen" title="no title" charset="utf-8">
  </head>
  <body>
    <div class="container">

    <h1>MySQL Quotes.</h1>
    <p>Created tables that hold quotes in a MySQL database.</p>
    <p>Coded php script that get's a random quote from the table.</p>
    <hr>
    <h4>Quote of the day ... [version 3]</h4>
    <?php
    // Get number of existing quotes in a table.
    $row_count = mysqli_query($connection, "SELECT COUNT(*) FROM quote;");
    echo "Record count: " . print_r($row_count);
    // Generates a random number depending on number of quotes.
    # $random_number = rand(1, $row_count);

    /*



    */
    # Query construction to get quotes.
    # Get's both quote and author information.
    /*
    $quote_query = "SELECT * ";
    $quote_query.= "FROM quote, author
    WHERE quote.qid=1 AND author.aid=1;";

    # Contact database.
    $quote_result = mysqli_query($connection, $quote_query);
    # Test if there was a query error.
    if (!$quote_result) {
        die('Database query failed.');
    }*/

    ?>
    <div class="quote">
      <p>Quote</p>
      <a href="link">author</a>
      <div class="category">
        <p>Category</p>
      </div>

    </div>

    </div>
  </body>
</html>
