Welcome Guest, Not a member yet? Register   Sign In
find birthday
#1

[eluser]Bigil Michael[/eluser]
i want to find birthdays between two dates

my table structure is

Code:
id dateofbirth  birthday  birthmonth  email

1  2010-08-02    08        02          [email protected]
2  2009-08-02    08        02          [email protected]
3  2001-07-03    07        03          [email protected]

i want to find out birthdays between 2 dates?

if 2 days are like this 2011-02-01 and 2011-02-28 it will show correct result

if i change the month 2011-02-01 and 2011-03-01 it doesnot give correct result?????

query used is
Code:
function list_date_email($d1,$m1,$d2,$m2,$limit,$pgoffset)
    {    
        $result_item = $this->db->query("SELECT id, first_name, email FROM cars_reservation  WHERE birth_day BETWEEN  '$d1' AND '$d2' AND birth_month BETWEEN '$m1' AND '$m2' LIMIT $pgoffset,$limit");
        return $result_item->result();
    }
here d1 =day1 m1=month1 d2=day2 m2=month2

i want to know what is the change required in the query to calculate birthdays between any two dates???
or any other method to find the birthday between two dates????
thanks in advance.....


Messages In This Thread
find birthday - by El Forum - 02-07-2011, 10:45 PM
find birthday - by El Forum - 02-07-2011, 11:25 PM
find birthday - by El Forum - 02-07-2011, 11:54 PM
find birthday - by El Forum - 02-08-2011, 03:18 AM
find birthday - by El Forum - 02-08-2011, 04:14 AM
find birthday - by El Forum - 02-08-2011, 09:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB