Jump to content


Don't find field in setRelation with where clause

setRelation Where

  • Please log in to reply
1 reply to this topic

#1 nunenthal

nunenthal

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts
  • LocationFrance

Posted 17 January 2020 - 10:51 AM

Hello,

 

I tried to write this :

 

        $crud->setRelation('dossier_id', 'dossier', 'nom_dossier',"dossier.user_id = '$client_id'");
 
The clause where use the alternative syntax, but I get the same error with traditionnal syntax in bracket
 
<p>Type: PDOException</p>
<p>Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'dossier.user_id' in 'where clause'</p>
<p>Filename: /home/quadralguy/public_html/application/libraries/GroceryCrudEnterprise/zendframework/zend-db/src/Adapter/Driver/Pdo/Connection.php</p>
<p>Line Number: 360</p>
 

The problem is that my column dossier.user_id really exist !!!

 

Please Help

.

 



#2 Soreno

Soreno

    Member

  • Members
  • PipPip
  • 14 posts

Posted 17 January 2020 - 03:41 PM

Hello, nunenthal.

Try this

$crud->setRelation('dossier_id', 'dossier', 'nom_dossier', ['user_id' => $client_id]);





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users