Welcome Guest, Not a member yet? Register   Sign In
_assign_libraries error when adding to the database
#1

[eluser]Tomer Simis[/eluser]
Hello guys, im new to the frameworks world and i choose the codeigniter to start. I saw the videos on the site and a few tutorials on the internet. Now im practicing, and im getting a error when im doing a insert to the database.

The error: Fatal error: Call to undefined method Pedidos::_assign_libraries() in C:\wamp\www\codeigniter\system\libraries\Loader.php on line 185

Controller
Code:
class Pedidos extends Controller{
    
    function Pedidos(){
        parent::Controller();
    }
    
    function index(){
        $this->load->view('pedidos');
    }
    
    function enviar(){
        $this->load->model('pedidos');
        $nome = $this->input->post('nome');
        $email = $this->input->post('email');
        $pedido = $this->input->post('pedido');
        $this->Pedidos_model->enviarPedido($nome,$email,$pedido);
    }
    
}

Model
Code:
class Pedidos_model extends Model{
    
    function Pedidos_model(){
        parent::Model();
    }
    
    function enviarPedido($nome,$email,$pedido){
        $this->db->query("INSERT INTO pedidos (nome,email,pedido) VALUES ('$nome','$email','$pedido')");
    }
    
}

View
Code:
<html>

<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <meta name="author" content="Tomer Simis" />

    <title>Pedidos</title>
</head>

<body>

<form action="enviar" name="enviar" method="post" enctype="text/plain">

<p>
<label>Nome
&lt;input type="text" name="nome" maxlength="20" /&gt;
</label><br />
</p>

<p>
<label>Email
&lt;input type="text" name="email" maxlength="50" /&gt;
</label><br />
</p>

<p>Pedido
&lt;textarea name="pedido"&gt;&lt;/textarea>
</p>

&lt;input type="submit" value="Enviar pedido" /&gt;

&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;

Please, help me guys :down:
Sorry for any english mistake, im brazillian

Thanks


Messages In This Thread
_assign_libraries error when adding to the database - by El Forum - 10-09-2009, 07:52 PM
_assign_libraries error when adding to the database - by El Forum - 10-10-2009, 01:54 AM
_assign_libraries error when adding to the database - by El Forum - 10-10-2009, 06:11 PM
_assign_libraries error when adding to the database - by El Forum - 10-10-2009, 07:05 PM
_assign_libraries error when adding to the database - by El Forum - 10-10-2009, 07:24 PM
_assign_libraries error when adding to the database - by El Forum - 10-11-2009, 04:43 PM
_assign_libraries error when adding to the database - by El Forum - 10-12-2009, 02:50 PM
_assign_libraries error when adding to the database - by El Forum - 10-25-2009, 02:54 PM
_assign_libraries error when adding to the database - by El Forum - 05-10-2010, 03:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB