Welcome Guest, Not a member yet? Register   Sign In
MySQL - master - slave
#8

(02-09-2016, 07:33 AM)mwhitney Wrote: If you need to build your query with Query Builder for some reason, just use $this->db->get_compiled_select() (/_insert()/_update()/_delete()) to get the SQL generated by Query Builder, then pass it to $this->db->query() with your comments. For example:

PHP Code:
$this->db->select('something')->from('somewhere');
$sql $this->db->get_compiled_select();
$this->db->query(sprintf("/*%s*/{$sql}"MYSQLND_MS_MASTER_SWITCH)); 

If that doesn't work for some reason, you can try passing it to simple_query() instead of query().

I will try in this way, thanks Smile
Reply


Messages In This Thread
MySQL - master - slave - by consigliere - 01-25-2016, 03:13 PM
RE: MySQL - master - slave - by sv3tli0 - 01-25-2016, 11:00 PM
RE: MySQL - master - slave - by consigliere - 01-29-2016, 07:48 PM
RE: MySQL - master - slave - by sv3tli0 - 01-29-2016, 11:33 PM
RE: MySQL - master - slave - by siburny - 01-30-2016, 08:08 PM
RE: MySQL - master - slave - by consigliere - 02-08-2016, 06:50 PM
RE: MySQL - master - slave - by mwhitney - 02-09-2016, 07:33 AM
RE: MySQL - master - slave - by consigliere - 02-09-2016, 07:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB