Welcome Guest, Not a member yet? Register   Sign In
db stuff
#1

[eluser]sasori[/eluser]
is it mandatory to create a function first on the controller before
being allowed to execute an insert or any db stuff queries? :question:
e.g
I loaded the $this->load->database() from the constructor and then at the bottom I did these,
Code:
$data = array(
                'url'=> 'www.mynewclient.com',
                'name' => 'bigco inc',
                'id' => '33',
                );

    $this->db->insert('sites',$data);
when I ran the page, I received a T_Function error.
then when I wrapped those query inside a function and it worked :gulp:


Messages In This Thread
db stuff - by El Forum - 01-09-2010, 05:11 AM
db stuff - by El Forum - 01-09-2010, 08:37 AM
db stuff - by El Forum - 01-09-2010, 11:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB