CodeIgniter Forums
Using constants within db requests - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Using constants within db requests (/showthread.php?tid=30900)



Using constants within db requests - El Forum - 05-29-2010

[eluser]newtonianb[/eluser]
I've defined a bunch of constants for each of my tables to keep things organised, now how can I use them in my requests?

If I try something like below
$this->db->from(DBTABLE_MYTABLEB . ' m');

I get error as it tries to use DBTABLE_MYTABLES as the actual value. I remember reading in the docs you could specify a third argument to prevent data from being escape but how can I make that happen for from and db related functions that are not 'set'


Using constants within db requests - El Forum - 05-29-2010

[eluser]newtonianb[/eluser]
please delete, it actually works I just defined the constant in the wrong project Smile
thanks