Welcome Guest, Not a member yet? Register   Sign In
Active Record Problem with queries with single quotes
#1

[eluser]Unknown[/eluser]
Hey guys, I'm trying to make queries with single quotes since two weeks but experiencing issues. Maybe one of you will get an idea... I've browsed forums hours...

I'm requesting an oracle DB and try to pass this query:

$this -> db -> select("to_char(RV_ETU.HEURE, 'HH24:MI' )");


And whatever I try (tried escaping etc) it gets converted to:

SELECT to_char(RV_ETU.HEURE, "'HH24:MI'" )

Which doesn't work.

Do you have an idea how to do it ?

Many thanks Smile
#2

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums!

$this->db->select() accepts a second parameter which allows you to prevent escaping. It's all in the user guide. Wink

Code:
$this->db->select("TO_CHAR(RV_ETU.HEURE, 'HH24:M')", FALSE);
#3

[eluser]Unknown[/eluser]
Hey, thanks for the fast answer!

I'm too stupid I missed it :S




Theme © iAndrew 2016 - Forum software by © MyBB