Welcome Guest, Not a member yet? Register   Sign In
get result from database equal today
#1
Question 
(This post was last modified: 05-02-2021, 02:13 AM by viracoders.)

I need to get posts of today from database using where

PHP Code:
// Get Today Time
$time Time::today('America/Chicago''en_US');
$today $time->toDateString(); // 2021-02-05

$testModel = new \App\Models\TestModel();
$results $testModel->getLatest($today); 

in Model (getLatest): 

PHP Code:
$builder $this->db->table('posts p');
$builder->select('p.*');
$builder->where('???????????????',$today);
$builder->orderBy('created_at''ASC');
$prices $builder->get()->getResultObject(); 

How do can I generate this query using where OR another method?
Reply


Messages In This Thread
get result from database equal today - by viracoders - 05-02-2021, 02:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB