Jump to content


Column not found: 1054 Unknown column in where clause

relation setrelation column where

  • Please log in to reply
No replies to this topic

#1 ajuser

ajuser

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 12 February 2020 - 07:57 AM

Good, I am trying to make a simple relationship between two tables, but when I put the where clause, it shows that it does not find the idcentro column.
I detail the controller code and the image of the tables.
In the community version it works without problems.
 
 
<p>Type: PDOException</p>
<p>Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'idcentro' in 'where clause'</p>
<p>Filename: /var/www/vhosts/control.instalnox.com/httpdocs/application/libraries/GroceryCrudEnterprise/zendframework/zend-db/src/Adapter/Driver/Pdo/Connection.php</p>
<p>Line Number: 360</p>

 

 

function list_contrato() {

      $crud = $this->_getGroceryCrudEnterprise();  
      $center = $this->session->userdata('idcentro');
      $crud->settable('contrato');
      $crud->setsubject('Contratos');
      $crud->columns(['idpersona','descripcion','fechadesde','fechahasta','numerohora'])
        ->displayas('idpersona','Trabajador')
        ->displayas('descripcion','DescripciĆ³n')
        ->displayas('fechadesde','Desde fecha')
        ->displayas('fechahasta','Hasta fecha')
        ->displayas('numerohora','Horas semanales');
      $crud->requiredfields(['idpersona','descripcion','fechadesde','numerohora']);
   //   $crud->setrules('fechahasta', 'Hasta', 'callback_valid_date');
 $crud->setrelation('idpersona','persona','{apellido}, {nombre}',['idcentro'=>$center]);
 $crud->where(['idcentro'=>$center]); 
      $output = $crud->render();
 $this->_main_output($output);
}

 

Attached Thumbnails

  • DB.png






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users