Select data from table where date = today |
Hello.
I want to select data from a table where the date is today,,but still not success yet. One of column is date,,that is where the date is saved, its mysql type data is date. $data['tbl_report'] = $this->db->query("SELECT * FROM tbl_report where sales_id= '".$this->session->id."' ")->result(); That is OK, all data is well output. But i want to show data that is only from today transaction. So I try this : $todaydate =date('Y-m-d'); $data['tbl_report'] = $this->db->query("SELECT * FROM tbl_report where sales_id= '".$this->session->id."' AND date= .$todaydate ")->result(); Its not error, but the table only shows empty result, nothing show up. How to fix that? |
Messages In This Thread |
Select data from table where date = today - by kelapamuda - 03-20-2020, 04:18 AM
RE: Select data from table where date = today - by jreklund - 03-20-2020, 10:48 AM
RE: Select data from table where date = today - by kelapamuda - 03-21-2020, 03:10 AM
RE: Select data from table where date = today - by jreklund - 03-21-2020, 04:31 AM
|