CodeIgniter Forums

Full Version: Active Directory with MySQL commands
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hi all,

New to using codeigniter and really love it!

I'm wondering whether I can use Active Directory functions with MySQL commands?

Like so:

$data = array(
   'uuid' => 'UUID()',
     'name' => $this->input->post('name'),
     'date' => 'UTC_TIMESTAMP()'

$this->db->insert('test', $data);

Any ideas?


El Forum

Anyone? Sad

El Forum

No, it doesn't. Get the value of UUID() and pass the value to store instead of the actual function. Otherwise it will just store that "UUID()" as literal text.

El Forum

Okay cool. Thanks for the answer.

El Forum

You can use built-in MySQL commands using set() and then insert() instead of insert() by itself. Look at the User Guide section for set(), it will tell you how to keep it from auto-escaping.