Welcome Guest, Not a member yet? Register   Sign In
builder - trying to escape and array using set() for insert or update
#1
Wink 

Hi guys,

i am trying to use the following to escape an array of data before updating the database - i just can't seem to get it to work.
(the line $builder->set($data) should escape the data - which references system/Database/BaseBuilder.php)

$data = [
    'title' => $title,
    'name'  => $name,
    'date'  => $date,
];

$builder->where('id', $id);
$builder->set($data);
$builder->update();

(documentation ref: https://www.codeigniter.com/user_guide/d...ating-data)

Many thanks for any help.
Reply
#2

(12-15-2021, 12:46 PM)simonf Wrote: i am trying to use the following to escape an array of data before updating the database - i just can't seem to get it to work.


It must be escaped. How do you know it is not escaped?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB