Jump to content

Featured Replies

Posted

This code …

$recordClass::getItemsWithPermission( array(array('category_id=?',$record->container()->id), …

Results in “Column 'category_id' in where clause is ambiguous” in developer mode. How can I make the call unambiguous? I haven’t found anything about using aliases in such a call with getItemsWithPermission and prepared statements. 

(Manually adding the column name works of course, but I am not sure that’s the cleanest and recommended solution.)

Edited by opentype

Solved by Martin A.

Go to solution
  • Solution
$recordClass::getItemsWithPermission( [ [ "`cms_custom_database_{$record::$customDatabaseId}`.`category_id`=?",$record->container()->id ] ], ... )

This should work

Recently Browsing 0

  • No registered users viewing this page.