Welcome Guest, Not a member yet? Register   Sign In
oci NOT A VALID MONTH
#1
Exclamation 

Hello i am new in codeigniter ., i was building the website development using oracle database.

and i got error code :

Quote:Error Number: 1843


ORA-01843: not a valid month
SELECT "A"."ID_PROYEK", "A"."NAMA_PROYEK", "A"."TGL_RENCANA_MULAI", "A"."TGL_RENCANA_SELESAI", "B".* FROM "RAB_PROYEK" "A" LEFT JOIN "NEW_TL_PEMINJAMAN" "B" ON "A"."ID_PROYEK"="B"."PR_ID" WHERE "B"."STATUS" IS NOT NULL AND "A"."TGL_RENCANA_MULAI" > '01-01-2020' ORDER BY "B"."STATUS" DESC




But when i run in oracle database in run well.

someone can help me ? or explain me ?

this is my code :

PHP Code:
$select  'A.ID_PROYEK , A.NAMA_PROYEK , A.TGL_RENCANA_MULAI,  A.TGL_RENCANA_SELESAI ,';
$select .= 'B.* ';
$from    'RAB_PROYEK A ';
$join['data'][] = [
   'table' => 'NEW_TL_PEMINJAMAN B',
   'join'  => 'A.ID_PROYEK=B.PR_ID',
   'type'  => 'LEFT',
];
$where['data'][] = [
   'column' => 'A.TGL_RENCANA_MULAI >',
   'param'  => '01-01-'.date('Y')
];
$proyeks $this->query->get_data_complex($select,$from,  NULLNULLNULL$join$wherenull null $order_by); 

PHP Code:
The query (models)

function 
get_data_complex($select NULL$table NULL$limit NULL$like NULL$order NULL$join NULL$where NULL$where2 NULL$group_by NULL$orderby null$distinct null)
    {
        
$this->db->select($select);
        
$this->db->from($table);
        if (
$join) {
            for (
$i 0$i sizeof($join['data']); $i++) {
                
$this->db->join($join['data'][$i]['table'], $join['data'][$i]['join'], $join['data'][$i]['type']);
            }
        }
        if (
$where) {
            for (
$i 0$i sizeof($where['data']); $i++) {
                
$this->db->where($where['data'][$i]['column'], $where['data'][$i]['param']);
            }
        }
        if (
$where2) {
            
$this->db->group_start();
            for (
$i 0$i sizeof($where2['data']); $i++) {
                
$this->db->or_where($where2['data'][$i]['column'], $where2['data'][$i]['param']);
            }
            
$this->db->group_end();
        }
        if (
$like) {
            
$this->db->group_start();
            foreach (
explode(','$like['data'][0]['column']) as $i => $value) {
                if (
$i == 0$this->db->like($value$like['data'][0]['param'], 'BOTH');
                else 
$this->db->or_like($value$like['data'][0]['param'], 'BOTH');
            }
            
$this->db->group_end();
        }
        if (
$limit) {
            
$this->db->limit($limit['finish'], $limit['start']);
        }
        if (
$order) {
            for (
$i 0$i sizeof($order['data']); $i++) {
                
$this->db->order_by($order['data'][$i]['column'], $order['data'][$i]['type']);
            }
        }
        if (
$group_by) {
            
$this->db->group_by($group_by);
        }

        if (
$orderby) {
            
$this->db->order_by($orderby);
        }

        if (
$distinct) {
            
$this->db->distinct();
        }

        
$query $this->db->get();
        return 
$query;
        
    } 


thanks for advice!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB