CodeIgniter Forums
Active Directory with MySQL commands - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter Archived (from EllisLab) (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Active Directory with MySQL commands (/thread-49385.html)



Active Directory with MySQL commands - El Forum - 02-17-2012

[eluser]Halmat[/eluser]
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:

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

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

Any ideas?

Thanks,
Halmat


Active Directory with MySQL commands - El Forum - 02-21-2012

[eluser]Halmat[/eluser]
Anyone? Sad


Active Directory with MySQL commands - El Forum - 02-21-2012

[eluser]CroNiX[/eluser]
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.


Active Directory with MySQL commands - El Forum - 02-21-2012

[eluser]Halmat[/eluser]
Okay cool. Thanks for the answer.


Active Directory with MySQL commands - El Forum - 02-21-2012

[eluser]Aken[/eluser]
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.