I shall look this over in detail momentarily. I am not sure if this will do what i'm looking for, however I do believe it will help me in something different i'm doing. Some of it i can certainly use immediately. Thanx for the reply!
Let me clarify my previous post --
I have a 3 select fields on the page for the date:
month, day, year
I want to populate the pull downs with 01-12, 01-31 and 2002-xxxx.
And yes, it currently does query 3 different tables for the values for month,day,year. I agree, its a lot of activity that doesn't need to happen, however I am not sure how to populate the fields any other way other than old fashioned html. It seems this may end up being the best method, however I hope not 🙂
I could use (and currently am) the normal html <select> <option value="1">1</option> and so forth. This leads to more junk on a page and larger than needed file size.
The 3 date fields in question are combined into a hidden field via my javascript validation script.
function checkReceivedDate(){
document.main.datereceived.value = ((document.main.year.value) + (document.main.month.value) +
(document.main.day.value));
}
The combined value is named "datereceived". It is a historical date field when someone received an item. It can be a week ago, a month ago etc.
$datereceived is inserted into a table in a field, coincidentally, called datereceived. This field is a TIMESTAMP(8). (YYYYMMDD).
Basically I want the user to be able to put in any date (assuming its a legal date in the past-- which i will use the checkdate on and find a way to compare it to the current date to make sure it is indeed in the past).
However what I DON'T want, is for the user to be able to type in a date... that just begs for trouble. I want them only to have select box options that = $datereceived in the YYYYMMDD format so it can be inserted into the table.
The way I currently have it works just fine. I would like to have it so there is no extra date junk in the html portion of the page. And since I'm learning php, I figured this would be a good way to learn about how php/ mysql handles dates.
Your reply may do exactly that, but to be honest, I need to go over it with a fine toothed comb and look at everything in depth before I can say for sure.
Thanks again for the help!
Nico