• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
is there any way to pass mysql's NOW() to mysql ?

#8
[eluser]gtech[/eluser]
when you pass your params through the insert function all the quotes have slashes added to them as the set() function is called within the insert() function with escape set to TRUE.

it would be the same as doing:
Code:
//Data
$data = array(
    'ID' => '',
    'Hash' => $params['file_name']
);  
//use true instead and value will be inserted as \'NOW()\' meaning 'NOW()' will be inserted into the database.
$this->db->set('DateUploaded', 'NOW()',TRUE);
$this->db->set($data);

$this->db->insert('Photos');

thats why it wont work, active record is built to escape strings as default.


Messages In This Thread
is there any way to pass mysql's NOW() to mysql ? - by El Forum - 03-03-2008, 05:00 AM
is there any way to pass mysql's NOW() to mysql ? - by El Forum - 03-03-2008, 05:10 AM
is there any way to pass mysql's NOW() to mysql ? - by El Forum - 03-03-2008, 05:12 AM
is there any way to pass mysql's NOW() to mysql ? - by El Forum - 04-22-2008, 01:58 PM
is there any way to pass mysql's NOW() to mysql ? - by El Forum - 04-22-2008, 02:13 PM
is there any way to pass mysql's NOW() to mysql ? - by El Forum - 04-22-2008, 02:15 PM
is there any way to pass mysql's NOW() to mysql ? - by El Forum - 04-22-2008, 02:24 PM
is there any way to pass mysql's NOW() to mysql ? - by El Forum - 04-22-2008, 02:26 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.