Posts

Showing posts from January, 2020

Multiple Like clauses with where condition in CodeIgniter

Many time we stuck in some situation if we want add multiple like queries with where condition, So for this, you should use Grouping where clause, see below example: $this->db->where('status','1'); $this -> db -> group_start (); //group start $this->db->like('contact_name',$filter_key); $this->db->or_like('contact_email',$filter_key); $this->db->or_like('contact_number',$filter_key); $this->db->or_like('company_name',$filter_key); $this->db->group_end(); //group end $query = $this->db->get('contacts');

Solved - MySQL server has gone away in wammp

Hi Guys, MySQL server has gone away error occurs when you passed max allowed packets may be your query will be crossed max number of line.   Follow below steps to fix:  Go to MySQL installed folder C:\wamp64\bin\mysql\mysql5.7.23 Open my.ini and find max_allowed_packet   Increase  max_allowed_packet  variable Restart wammp or MySQL server