So beitragen Sie Tabellen korrekt in CodesigniterPhp

PHP-Programmierer chatten hier
Anonymous
 So beitragen Sie Tabellen korrekt in Codesigniter

Post by Anonymous »

Dies sind meine Modelle < /p>

Code: Select all

function report($where = '')
{
$this->db->select(array('o.id_order AS id_order', 'nama_pemesan', 'kota', 'total', 'SUM(biaya) AS do.biaya'));

$this->db->from('t_order o JOIN t_detail_order do ON (o.id_order = do.id_order)');

$this->db->where($where);
$this->db->group_by('o.id_order');

return $this->db->get();
}
this is my table t_order

t_order

this is my table t_detail_order

t_detail_order

this is the error

Fehler < /p>

Dies ist mein Controller-Bericht < /p>


public function report ()
{
$ this-> load-> Bibliothek ('Form_validation');

Code: Select all

          if ($this->input->post('submit', TRUE) == 'Submit')
{
$this->form_validation->set_rules('bln', 'Bulan', 'required|numeric');
$this->form_validation->set_rules('thn', 'Tahun', 'required|numeric');

if ($this->form_validation->run() == TRUE)
{
$bln = $this->input->post('bln', TRUE);
$thn = $this->input->post('thn', TRUE);
}

} else {
$bln = date('m');
$thn = date('Y');
}
//YYYY-mm-dd
//2017-04-31
$awal  = $thn.'-'.$bln.'-01';
$akhir = $thn.'-'.$bln.'-31';

$where = ['tgl_pesan >=' => $awal, 'tgl_pesan

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post