This about update_string/insert string |
[eluser]Lima[/eluser]
How can I built query using db->update_string() or db->insert_string() method Query result has value from database function Ex: UPDATE my_table SET field1=NOW(), field2=db_function('param1', 'param2') WHERE id='20100205'; Thank You
[eluser]theprodigy[/eluser]
Quote:UPDATE my_table SET field1=NOW(), field2=db_function(‘param1’, ‘param2’) WHERE id=‘20100205’; Code: $data = array('field1' => 'NOW()', 'field2' => $this->db_function($param1, $param2)); should do it, but I'm not exactly sure about the NOW() part as this function automatically escapes values for safer queries. Test run produced: Code: $param1 = 'param1';
[eluser]Lima[/eluser]
I think it is not possible to generate that query using update_string() method
[eluser]Bart v B[/eluser]
It is nog possible like that way i think. I had the same problem last week. Take a look at this threat: http://ellislab.com/forums/viewthread/73126/ This should solve youre problem ;-)
|
Welcome Guest, Not a member yet? Register Sign In |