Where clause in editor post action
Where clause in editor post action
mRender
Posts: 151Questions: 26Answers: 13
I was wondering why I was getting invalid JSON from this because of my where clause.
if ( !isset($_POST['action']) ) {
// Get a list of sites for the `select` list
$data['tbl_Login'] = $db
->selectDistinct( 'tbl_Login', 'UID as value, email as label' )
->where('UID', 1)
->fetchAll();
}
Shouldn't I be able to have a where clause and only select the users with UID = 1?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The
selectDistinct
method returns aResult
- not aQuery
instance, so it doesn't have awhere
method.You can pass in a third parameter to
selectDistinct
to act as a select (docs).Allan