我目前正在执行电子商务系统。我想监测当月有多少人购买了特定产品。例如,我正在销售耳机,5月份购买1月份的耳机,2月份等等。使用Codeigniter计算特定月份的所有月份
问题:是否可以在我的表中将存储值中的mm分开?
注:我用在HTML中的日期选择器(在HTML日期选择的格式为YYYY-MM-DD)
CONTROLLER
$data['products'] = $this->CrudModel->count_all('products','date');
print_r($data['products']);die;
MODEL
public function count_all($table,$date)
{
$this->db->select('product_name');
$this->db->from($table);
$this->db->where(array('date' => '$date')); // What should I put here? So that I can fetch the date starting January until December
$num_results = $this->db->count_all_results();
}
我的PRODUCT产品列表
'event_id' 'full_name' 'email' 'date' 'contact'
您可以通过使用组。 – shafiq
对不起,对于最近的回复..先生? – Angel