Hi all,
O.K. I don't know if this is a PHP or MySQL question, but since I'm doing the code in PHP, I'll start here.
This is my first attempt at doing anything with PHP.
So far so good! I have an address DB in MySQL in two tables. (names & address) This includes Birthdays.
I have a sql statement that pulls all the data and then I display it in a table (html). All that works fine.
Now I want to have links or buttons or maybe even a drop down box to select age groups.
i.e. $result = @mysql_query("SELECT * FROM names, address WHERE address.famID=names.famID AND (bd >= '1986-01-01' AND bd <= '1988-12-31')"
;
This will give me all the kids that are 17 and turning 18
But I can't just use this code for this selection. Because next year and the next year it will be wrong if I use static years.
What I would like, is to have a link that says "Kids 17 - 18" and have it find all kids who will be 17 - 18 between Jan 1st and Dec 31st.
I need this for other age groups as well.
Any ideas?
tgus
____________________________
Families can be together forever...
O.K. I don't know if this is a PHP or MySQL question, but since I'm doing the code in PHP, I'll start here.
This is my first attempt at doing anything with PHP.
So far so good! I have an address DB in MySQL in two tables. (names & address) This includes Birthdays.
I have a sql statement that pulls all the data and then I display it in a table (html). All that works fine.
Now I want to have links or buttons or maybe even a drop down box to select age groups.
i.e. $result = @mysql_query("SELECT * FROM names, address WHERE address.famID=names.famID AND (bd >= '1986-01-01' AND bd <= '1988-12-31')"
This will give me all the kids that are 17 and turning 18
But I can't just use this code for this selection. Because next year and the next year it will be wrong if I use static years.
What I would like, is to have a link that says "Kids 17 - 18" and have it find all kids who will be 17 - 18 between Jan 1st and Dec 31st.
I need this for other age groups as well.
Any ideas?
tgus
____________________________
Families can be together forever...