how to make a date based blog archieve in ci3 using query builder - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: how to make a date based blog archieve in ci3 using query builder (/showthread.php?tid=1312) |
how to make a date based blog archieve in ci3 using query builder - ngangchill - 02-27-2015 hellow everyone! i think its a stupid question but i cant figured it out. i want to make a blog archieve based on date i.e January 2015 (4) // month_name (total_post number) February 2015 (1) etc..... please some one help me.plz discuss in details such as table (date column type), and query builder... Thnx. RE: how to make a date based blog archieve in ci3 using query builder - Wouter60 - 02-27-2015 Try this: Code: $this->db->select('DATE_FORMAT(datetime,"%Y%m") AS month',NULL,FALSE) The result is an array with rows. Each row has the columns 'month' and 'num_per_month'. E.g.: $r['month'] => '201501' stands for: January 2015. RE: how to make a date based blog archieve in ci3 using query builder - frocco - 02-27-2015 Code: $this->db->select('*, count(*) as cnt')->from('blogs'); Code: foreach ($query->result() as $row) { RE: how to make a date based blog archieve in ci3 using query builder - ngangchill - 02-27-2015 thnx #Wouter60 & #frocco RE: how to make a date based blog archieve in ci3 using query builder - ngangchill - 03-01-2015 (02-27-2015, 11:59 AM)Wouter60 Wrote: Try this: is it works in sqlit3? if answer is not, than what will be the solution. thanks. |