Re: [PHP] Between Query (0T)

2005-05-09 Thread Burhan Khalid
Ryan A wrote: clip Your looking at something like. For ages between 21 and 23 $Upper = date(m-d-Y, mktime(0,0,0,date(m),date(d),date(y)-22)); $Lower = date(m-d-Y, mktime(0,0,0,date(m),date(d),date(y)-23)); $sql = SELECT field1,field2,field3 FROM `table_name` WHERE `age` BETWEEN . $Lower . AND .

Re: [PHP] Between Query (0T)

2005-05-09 Thread Ryan A
On 5/9/2005 9:47:50 AM, Burhan Khalid ([EMAIL PROTECTED]) wrote: Ryan A wrote: clip Your looking at something like. For ages between 21 and 23 $Upper = date(m-d-Y, mktime(0,0,0,date(m),date(d),date(y)-22)); $Lower = date(m-d-Y, mktime(0,0,0,date(m),date(d),date(y)-23)); $sql

Re: [PHP] Between Query (0T)

2005-05-09 Thread andreja
I am not sure but maybe something like this is posible $current_year = date(Y); $qry = SELECT * FROM `table` WHERE ($current_year-YEAR(birthday)) BETWEEN 25 AND 26 Matthew Weier O'Phinney [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] * Ryan A [EMAIL PROTECTED] : Thanks for

RE: [PHP] Between Query (0T)

2005-05-09 Thread Kim Madsen
-Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Monday, May 09, 2005 1:02 PM Luck and me? You dont know who you are talking to my friendI am still on mysql 3.23 not even 4.1 !!! TO_DAYS() works on 3.23 too ;-) -- Med venlig hilsen / best regards ComX

Re: [PHP] Between Query (0T)

2005-05-09 Thread Matthew Weier O'Phinney
* [EMAIL PROTECTED] [EMAIL PROTECTED] : I am not sure but maybe something like this is posible $current_year = date(Y); $qry = SELECT * FROM `table` WHERE ($current_year-YEAR(birthday)) BETWEEN 25 AND 26 No -- because this incorrectly identifies somebody born on June 14 as 26 even

[PHP] Between Query (0T)

2005-05-08 Thread Ryan A
Hi, Sorry I know this is OT but I'm hoping someone will still help...it should be quite simple :-) I have a field in the database called age which is a DATE field. I also have a webform where the user can select between which ages he wants the records shown... eg: if he types 23,25 then I should

Re: [PHP] Between Query (0T)

2005-05-08 Thread Andy Pieters
On Sunday 08 May 2005 15:20, Ryan A wrote: Hi, Sorry I know this is OT but I'm hoping someone will still help...it should be quite simple :-) I have a field in the database called age which is a DATE field. I also have a webform where the user can select between which ages he wants the

Re: [PHP] Between Query (0T)

2005-05-08 Thread Duncan Hill
On Sunday 08 May 2005 14:20, Ryan A wrote: Hi, Sorry I know this is OT but I'm hoping someone will still help...it should be quite simple :-) I have a field in the database called age which is a DATE field. http://dev.mysql.com/doc/mysql/en/comparison-operators.html 'BETWEEN' -- PHP

Re: [PHP] Between Query (0T)

2005-05-08 Thread Ryan A
Hey, Thanks for replying. SELECT * FROM `table` WHERE `age` BETWEEN 25 AND 26; I knew the above, but how do i use it with my date field when i have birthdates like this: 01-01-1969 and 03-05-1955 Thanks, Ryan On 5/8/2005 4:28:44 PM, Andy Pieters ([EMAIL PROTECTED]) wrote: On Sunday 08

Re: [PHP] Between Query (0T)

2005-05-08 Thread bala chandar
Hi, On 5/8/05, Ryan A [EMAIL PROTECTED] wrote: Hi, Sorry I know this is OT but I'm hoping someone will still help...it should be quite simple :-) I have a field in the database called age which is a DATE field. are u storing in terms of Date of Birth??? if so the below lines u cannot do

Re: [PHP] Between Query (0T)

2005-05-08 Thread Matthew Weier O'Phinney
* Ryan A [EMAIL PROTECTED] : Thanks for replying. SELECT * FROM `table` WHERE `age` BETWEEN 25 AND 26; I knew the above, but how do i use it with my date field when i have birthdates like this: 01-01-1969 and 03-05-1955 Just like you would in the example above -- only with dates that

Re: [PHP] Between Query (0T)

2005-05-08 Thread Ryan A
On 5/8/2005 5:33:46 PM, Richard Collyer ([EMAIL PROTECTED]) wrote: Ryan A wrote: Hi, Sorry I know this is OT but I'm hoping someone will still help...it should be quite simple :-) I have a field in the database called age which is a DATE field. I also have a webform where the user

Re: [PHP] Between Query (0T)

2005-05-08 Thread Ryan A
On 5/8/2005 4:31:18 PM, Duncan Hill ([EMAIL PROTECTED]) wrote: On Sunday 08 May 2005 14:20, Ryan A wrote: Hi, Sorry I know this is OT but I'm hoping someone will still help...it should be quite simple :-) I have a field in the database called age which is a DATE field.

Re: [PHP] Between Query (0T)

2005-05-08 Thread Richard Collyer
Ryan A wrote: On 5/8/2005 5:33:46 PM, Richard Collyer ([EMAIL PROTECTED]) wrote: Ryan A wrote: Hi, Sorry I know this is OT but I'm hoping someone will still help...it should be quite simple :-) I have a field in the database called age which is a DATE field. I also have a webform where the user

Re: [PHP] Between Query (0T)

2005-05-08 Thread Ryan A
clip Your looking at something like. For ages between 21 and 23 $Upper = date(m-d-Y, mktime(0,0,0,date(m),date(d),date(y)-22)); $Lower = date(m-d-Y, mktime(0,0,0,date(m),date(d),date(y)-23)); $sql = SELECT field1,field2,field3 FROM `table_name` WHERE `age` BETWEEN . $Lower . AND . $Upper;

Re: [PHP] Between Query (0T)

2005-05-08 Thread Matthew Weier O'Phinney
* Richard Collyer [EMAIL PROTECTED] : Ryan A wrote: On 5/8/2005 5:33:46 PM, Richard Collyer ([EMAIL PROTECTED]) wrote: Ryan A wrote: Sorry I know this is OT but I'm hoping someone will still help...it should be quite simple :-) I have a field in the database called age which is a