php - How to execute prepared statement in CodeIgniter -
I have the following statement that I can execute in MySQL:
set @sql = Zero; Select group_concat (``, name, '`') as' DISTINCT'MAX (IF (name = '', name, '', name, zero)) @sql check from Contact_Types; Setting @sql = concat ('select c.First_Name,', @sql, 'Contact left c.contact_id = cct.contact_Id at Contacts_Contact_Types to join CCT. C from c.contact_Id contact_Types cct.Contact_Type_Id = ct.Contact_Type_Id group But left to join whistle '); Make the statement from @sql; Conclusion statement; DEALLOCATE Ready Statement;
This prepared statement allows me to dynamically retrieve the "contact type" associated with a contact. How can I execute this prepared statement in CodeIgniter and get results? I can not find any mention of this in the CI document
I get a SQL syntax error when trying to execute by following the following:.
$ this-> Db - & gt; Question ("Prepare Statement from @sql; Execute the statement; Re-allocation statement;");
Thanks for any help!
Comments
Post a Comment