Codeigniter error to execute update command in oracle database. DB_driver.php, Line Number: 330

963

when I am going to update my table in oracle db from codeigniter, I am getting an error,

Error Number: UPDATE BOTAB SET STATUS='y',TERMINAL='fazlay-pc',SLNO='101',REGNO='36' WHERE BOAC='1204260035198795'; Filename: C:\xampp\htdocs\agm_ci\system\database\DB_driver.php Line Number: 330

Yet my project is smoothly performing SELECT command from this table.

here is my model function.....

public function updateStatus($data)
{
    $update_data['regno'] = $data['regno'];
    $update_data['attendence'] = $data['attendence'];
    $update_data['terminal'] = $data['terminal'];
    $update_data['slno'] = $data['slno'];
    $update_data['index'] = $data['index'];

    $query = $this -> db -> query("UPDATE BOTAB SET STATUS='".$update_data['attendence']."',TERMINAL='".$update_data['terminal']."',SLNO='".$update_data['slno']."',REGNO='".$update_data['regno']."'  
    WHERE BOAC='".$update_data['index']."'; ");
}

my db configuration is as follows.....

$db['default']['hostname'] = $tnsname;
$db['default']['username'] = 'XXXXX';
$db['default']['password'] = 'XXXXX';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'oci8';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

Thanks in advance.

102

Answer

Solution:

Why don't use codeigniter built in update function.
It may work for you

    $update_data['STATUS']=$data['attendence'];
    $update_data['TERMINAL']=$data['terminal'];
    $update_data['SLNO']=$data['slno'];
    $update_data['REGNO']=$data['regno'];

    $this->db->where('BOAC',$data['index']);
    $this->db->update('BOTAB',$update_data);

People are also looking for solutions to the problem: amazon web services - Aws PHP SDK S3 RequestTimeTooSkewed Error

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.