Welcome Guest, Not a member yet? Register   Sign In
$this->dblink
#1

[eluser]phpserver[/eluser]
I came across this line of code in someones controller file code and i tried it.

function save()
{
$item['id']=$this->input->post("id");
$item['job']=$this->input->post("job");
$this->dblink->put_item($item);
}

put_item is the model file.I tried running the code and the error was 'Undefined property:Toby::$dblink

My controller file is toby.php
#2

[eluser]tobyberesford[/eluser]
I'm not sure where the code you are getting this from is! But anyway

dblink is the name of the model - see models/dblink.php

It probably fails because the model hasn't been loaded earlier:

eg. $this->load->model("dblink");

Cheers

Toby
#3

[eluser]phpserver[/eluser]
[quote author="tobyberesford" date="1226793769"]I'm not sure where the code you are getting this from is! But anyway

dblink is the name of the model - see models/dblink.php

It probably fails because the model hasn't been loaded earlier:

eg. $this->load->model("dblink");

Cheers

Toby[/quote]

Hi Toby,visit http://www.phplondon.org/conference/2008...erview.pdf
#4

[eluser]tobyberesford[/eluser]
Ah thanks. I've now checked and have deleted all the original code for the demo I'm afraid.

Cheers

Toby




Theme © iAndrew 2016 - Forum software by © MyBB