Welcome Guest, Not a member yet? Register   Sign In
this id?
#2

[eluser]Tim Brownlaw[/eluser]
I'm not sure what your question is... Are you wanting to perform an Insert ( new Row ) or an update ( modify an existing row)? . It looks like you are wanting to perform an Update?

You have to keep an eye on what you have written,
So let's see what you will get with what you currently have
if $username = '[email protected]';
then
$data['email'] will equal [email protected]>id
"this->id" is simply a string you are concatenating to your username.

I "think" you are meaning...
$data = array('id => $this->id, 'email'=>$username);
So to reference any class property, in your case id, you need to use $this->id.

So the format for your array is... Which is simply an associative array where the index names are not numeric, but strings (names) that you assign...
Code:
$data = array(
'column_name_1'=>$column_name_1_value,
'column_name_2'=>$column_name_2_value,
...
'column_name_n'=>$column_name_n_value
);
Where column_name_x are the names of your Table Columns with their respective values.

Then you can create a New Table Row using...
Code:
$this->db->insert(‘users’, $data);

NEXT: Still doesn't answer your question...
You have stated that... // “this->id” is ID of this row ( which should be $this->id or it's something else completely!)
Where are you getting this from?

Now I'm going to suggest you go and read up on active records in the user guide cause I'm out of time, but hopefully that should get you started.
Have a look at - $this->db->update();


Messages In This Thread
this id? - by El Forum - 10-05-2014, 07:03 AM
this id? - by El Forum - 10-05-2014, 01:47 PM
this id? - by El Forum - 10-05-2014, 04:01 PM
this id? - by El Forum - 10-05-2014, 04:25 PM
this id? - by El Forum - 10-05-2014, 08:17 PM
this id? - by El Forum - 10-05-2014, 09:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB