Codeigniter - SQL query from view
I know its not meant to be done, but could someone show me how to run an SQL query f开发者_如何学运维rom a view.
Cheers
I assume you mean you want access to your models? You can get the main CodeIgniter object/controller with get_instance()
, and then access the model through that:
$ci =& get_instance();
$ci->Model_name->find(...);
精彩评论