Welcome Guest, Not a member yet? Register   Sign In
Matching Dates
#1

[eluser]james182[/eluser]
Could i get some help with matching dates?

i am trying to count matching dates 2012-04-04 to 2012-04-04 17:00:00
helper
Code:
if (!function_exists('event_counter'))
{
function event_counter($year, $month, $day)
{
  $dated = $year .'-'. $month .'-'. $day;
  $date_is = date('Y-m-d', strtotime($dated));

  $counted_events = ci()->calendar_m->count_date_events($date_is);

  return print_r($counted_events);
}

}

model
Code:
function count_date_events($date_is)
    {
  
  return  $this->db
      ->select("DATE_FORMAT(`event_date_begin`,'%Y-%m-%d') AS event_date_begin", FALSE)
            ->where('event_date_begin', $date_is)
      ->from('eventcal')
                  ->count_all_results();
    }


Messages In This Thread
Matching Dates - by El Forum - 08-16-2012, 04:50 AM
Matching Dates - by El Forum - 08-16-2012, 05:37 AM
Matching Dates - by El Forum - 08-16-2012, 09:11 PM
Matching Dates - by El Forum - 08-16-2012, 10:22 PM
Matching Dates - by El Forum - 08-16-2012, 10:50 PM
Matching Dates - by El Forum - 08-17-2012, 12:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB