Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14346

Show results based on a specific date

$
0
0
Hello, I would like to show the results from the database only inserted in a specific time frame. I would therefore like to show only the results that have been inserted by the date (example: 20 March 2018).

This is an example of proof, with other restrictions such as the most voted.

PHP Code:
public function test($limit=null$offset=null) {
 
       $this->db->select('*');
 
       $this->db->from('test');
 
       $this->db->where('status'1); // where status is 1 (active)
 
       $this->db->order_by('likes''DESC');
 
       $this->db->limit($limit);
 
       $this->db->offset($offset);
 
       $query $this->db->get();
 
       return $query->result_array();
 
   

Viewing all articles
Browse latest Browse all 14346

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>