I personally don’t think a think a database table is overkill, for one can simply do something like the following:
[php]<?php
require_once ‘lib/includes/utilities.inc.php’;
/* Here’s the structore of the database table
CREATE TABLE IF NOT EXISTS idiom
(
id
int(5) NOT NULL,
idiom
text NOT NULL,
meaning
text NOT NULL,
current_date
datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
*/
$current_date = new DateTime(“Now”, new DateTimeZone(‘America/Detroit’));
try {
$query = “SELECT idiom, meaning, daily_date FROM idiom WHERE daily_date >= CURDATE() AND daily_date < DATE_ADD(CURDATE(), INTERVAL 1 DAY)”;
$stmt = $pdo->prepare($query);
$result = $stmt->execute();
$row = $stmt->fetch(PDO::FETCH_OBJ);
} catch (Exception $exc) {
echo $exc->getTraceAsString();
}
?>
<?php echo $row->idiom; ?>
<?php echo $row->meaning; ?>
[/php]
Though I think daily_date should be unique in the database_table in order to avoid having two dates being the same.
Though how astonecipher is going about setting it up for using a text file is probably the best way to go for the OP question.