I'm using Dreamweaver CS5 and MySQL. I had a similar discussion about this on a previous post here:
The query I am using from that discussion is:
select description from Weather
where ID = 1 + MOD(
(EXTRACT(DAY FROM CURDATE())
* EXTRACT(MONTH FROM CURDATE())
* EXTRACT(YEAR FROM CURDATE())),
(select MAX(ID) from Weather));
I am working on adding a new feature to my website. I am having a hard time trying to change the query, instead of it randomly picking an ID from the table I want to to query in sequential order, then after hitting the max ID, returning to ID 1. I am using unique ID's for this SQL data base and there will be 28 rows.
Any help would be awesome! Thank you!
Update****
This works, only if I manually change the date to today 2017-02-02:
SELECT description
FROM `Moon`
WHERE ID = 1 + MOD(DATEDIFF('2017-01-01',CURDATE()), (SELECT MAX(ID) from `Moon`))";
<script type="text/javascript">
setInterval("my_function();",100000);
function my_function(){
$('#weather').load('website.php #today');
}
<div id="weather">
<div id="today">
<?php echo ucfirst($row_Recordset2['description']); ?>
</div>
</div>
I am using .load to refresh the data every 24 hours. How do I correct this so I won't have to manually update the date?