?>


<?php 
// Get passed in value.
$weatherID = $_GET["weatherid"];
// Check if weather id is an integer.  If not, sets the value to 0.
$weatherID = intval($weatherID);
// Only do this if passed in value is an integer and greater than 0.
if ($weatherID > 0) {
    // Files needed to create the connection object.
    // Use this format to get to the correct directory.
    include_once "../Configuration/Database-Connection-Constants.php";
    include_once "../Models/Flora-Database-Class.php";
    // Create dbConnection Object from the ConnectToDatabase class.
    $dbConnection = new ConnectToDatabase();
    // Call to "getter" function in class to get results of connection attempt.
    $connectionResult = $dbConnection->getConnectionResult();
    // Determine results of the connection attempt.
    if ($connectionResult == 0) {
        $connResult = 'The database connection was successful.';
    } else {
        $connResult = 'The database connection failed.  ' . 'Error Number ' . $connectionResult;
    }
    // Print connection result.
    print '<br />' . $connResult . '<br /><br />';
    // Only do this if successfully connected to the database.
    if ($connectionResult == 0) {
        // Delete all rows in the flora table with the passed in weather id.
        // SQL statement to gather data.
        $sqlStatement = "DELETE FROM floratable\n                             WHERE weathertable_weatherid = '{$weatherID}'";
mobile phone.

Coded by Rick Lamp.

Revised 12-6-2015
*/
?>


<?php 
// Files needed to create the connection object.
// Use this format to get to the correct directory.
include_once "../Configuration/Database-Connection-Constants.php";
include_once "../Models/Flora-Database-Class.php";
// Create dbConnection Object from the ConnectToDatabase class.
$dbConnection = new ConnectToDatabase();
// Call to "getter" function in class to get results of connection attempt.
$connectionResult = $dbConnection->getConnectionResult();
// Determine results of the connection attempt.
if ($connectionResult == 0) {
    $connResult = 'The database connection was successful.';
} else {
    $connResult = 'The database connection failed.  ' . 'Error Number ' . $connectionResult;
}
// Print connection result.
print '<br />' . $connResult . '<br /><br />';
// Only do this if successfully connected to the database.
if ($connectionResult == 0) {
    // Generate list of all rows in the weathertable.
    // SQL statement to gather data.
    $sqlStatement = "SELECT weatherid, skyconditions, precipitationconditions, windconditions,\n                         temperature\n                         FROM weathertable\n                         ORDER BY weatherid";