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

Order By Date Question

$
0
0
On my database column when a user creates a thread the date

I set date using php time()

Will it still sort date out correct if use time() instead of date() if not what would you recommend.

Because I need to be able to view the latest threads

PHP Code:
$this->db->order_by('date_created''desc'); 



PHP Code:
public function get_users_threads($user_id) {
        $this->db->where('user_id'$user_id);
        $this->db->order_by('date_created''desc');
        $thread_query $this->db->get($this->db->dbprefix 'thread');

        if ($thread_query->num_rows() > 0) {
            return $thread_query->result_array();
        } else {
            return FALSE;
        }
 



[Image: 3Cza7EBKPQUw.png]

Viewing all articles
Browse latest Browse all 14346

Trending Articles



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