Welcome Guest, Not a member yet? Register   Sign In
why is this code failing?
#1

(This post was last modified: 07-01-2020, 04:03 AM by richb201.)

I am trying to create an array that I will use to "insert" 2 fields into a table. I keep two important fields in a session variable. I want to insert them into a mySQL table. There seems to be a problem with the userdata('campaign'). Why is that?

$data = array(
    'email' => $this->session->userdata('userid'),
    'campaign' => '$this->session->userdata('campaign')
);


$this->db->insert($file_name, $data);

and I get this:
Type: ParseError

Message: syntax error, unexpected 'campaign' (T_STRING), expecting ')'

Filename: /app/application/libraries/Image_CRUD.php
Line Number: 368
proof that an old dog can learn new tricks
Reply


Messages In This Thread
why is this code failing? - by richb201 - 07-01-2020, 03:49 AM
RE: why is this code failing? - by neuron - 07-01-2020, 05:04 AM
RE: why is this code failing? - by InsiteFX - 07-03-2020, 06:59 AM
RE: why is this code failing? - by ivantcholakov - 07-03-2020, 08:01 AM
RE: why is this code failing? - by richb201 - 07-03-2020, 09:04 AM
RE: why is this code failing? - by richb201 - 07-06-2020, 03:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB