Hi there, I'm looking for some help on displaying the information in my database.
I can get the information to display correctly by using:
$results = mysql_query("SELECT * from week1");
$rows = mysql_fetch_assoc($results);
and then I use <? echo $rows['variable']; ?> to display it in the table.
The problem is that the data gets updated every week, and I want to know how I can get and display the most recent entry. I have an auto incrementing id number in the table but for some reason I can't get it to sort by using the id #. I've tried many different versions of:
$results = mysql_query("SELECT MAX(id) from week1");
but none of it seems to work. There is also a datetime field in the table, and I thought that I might be able to display it that way, but, depending on when the month starts, there are either 4 or 5 weeks in a month, so i thought it might be hard to sort the data by the date.
I'd appreciate any help that can be provided.
Thx,
Jim