php - Date Insertion Issue in Oracle Database and Codeigniter -


I have trouble updating the Oracle DB table with date column. I have tried many solutions but now Also not working I can not insert date into database codeigniter using active record or common query. Column type timestamp. Here are some solutions I can try Please help

  $ this-> Db- & gt; Set ('AC_START', 'TO_DATE (' 2014-03-4 2:30 ',' yyyy-mm-dd hH: mm ')); $ this-> db- & gt; set (' AC_END ' , 'TO_DATE (' 2014-05-5 2:34 ',' yyyy-mm-dd hh: mm ') "); $ This- & gt; Db- & gt; Putting ('activities');   

Here is the error message that I always get

Error number:

  INSERT "LI_PPPA". "Action" ("AC_START", "AC_END") value ('TO_DATE (' 2014-03-4 2:30 ',' yyyy-mm-dd hh: mm '),' TO_DATE ('2014-05-5 2:34 ',' Yyyy-mm-dd hh: mm ')')   

filename: directory \ program \ system \ database \ db_driver.php Line number: 330

You have to ensure that CI does not escape the original values ​​that you are going through the Oracle database. , Because To_date is an oracle function.

Try the following:

  $ this-> Db- & gt; Set ('AC_START', 'TO_DATE (' 2014-03-4 2:30 ',' yyyy-mm-dd hh: mm ') ", FALSE); $ This- & gt; Db- & gt; Set ('AC_END', 'TO_DATE (' 2014-05-5 2:34 ',' yyyy-mm-dd hh: mm ') ", FALSE); $ this-> db- & gt; insert (' Activity '); Code here   

You are telling the codigator to avoid that value.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -