Welcome Guest, Not a member yet? Register   Sign In
Escape Array in SQL. How to do it?
#4

[eluser]Karman de Lange[/eluser]
array(1,2,3,4,5,6) becomes:
'1','2','3','4','5','6'

Code:
if (is_array($branch_ids))
        {
            foreach ($branch_ids as $key => $branch_id)
            {

                $branch_ids[$key] = $this->db->escape($branch_id);
            }

            $branch_ids = implode(',', $branch_ids);

        }


Messages In This Thread
Escape Array in SQL. How to do it? - by El Forum - 02-14-2014, 05:34 PM
Escape Array in SQL. How to do it? - by El Forum - 02-14-2014, 05:52 PM
Escape Array in SQL. How to do it? - by El Forum - 02-15-2014, 09:59 AM
Escape Array in SQL. How to do it? - by El Forum - 02-15-2014, 10:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB