⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Error with add data set relation nn



ianag5
  • profile picture
  • Member

Posted 06 June 2018 - 16:28 PM

(first sorry for my english)

 

I have an error when I use add record with this database:

 

[attachment=1302:tablas db domicilio.png]

 

when I put the email ( it's in another table) and I click save, the page stays saving but never finishes:

 

[attachment=1303:insert.png]

 

 

Im forced to select cancel and when I show the data of the table "domicilio" the info of the table "alumno" doesn't shows up.

 

 

[attachment=1304:select.png]

 

my code:

class Domicilios extends BaseController
{
    public function __construct()
    {
        parent::__construct();
        $this->isLoggedIn();
        $this->load->library('grocery_CRUD');
    }

    public function index()
    {
        $this->global['pageTitle'] = 'Et 36: Domicilios';
        $this->relation();
    }
public function relation()
    {
        $crud = new grocery_CRUD();
        $crud->set_theme('datatables');
        $crud->set_table('tbl_domicilios');

        $crud->set_relation_n_n('DNI','tbl_domicilios_has_tbl_alumnos','tbl_alumnos','tbl_domicilios_id_domicilio',
            'tbl_alumnos_email','dni','tbl_alumnos_id_legajo');
        $crud->set_relation_n_n('nombre','tbl_domicilios_has_tbl_alumnos','tbl_alumnos','tbl_domicilios_id_domicilio',
            'tbl_alumnos_email','nombre','tbl_alumnos_id_legajo');
        $crud->set_relation_n_n('Email','tbl_domicilios_has_tbl_alumnos','tbl_alumnos','tbl_domicilios_id_domicilio',
            'tbl_alumnos_email','email','tbl_alumnos_id_legajo');

        $crud->add_fields('calle','altura','localidad','Email');
        $crud->edit_fields('calle','altura','localidad','Email');

        $crud->required_fields('calle','altura','localidad');

        $crud->columns(array('calle','altura','localidad','nombre','DNI'));

        $output = $crud->render();

        $this->global['pageTitle'] = 'Et 36: Domicilios';



        $this->loadViews('domicilios',$this->global,$output, null);
    }

how can i solve this? Thx