Answer the question
In order to leave comments, you need to log in
How to make a selection with a condition in Drupal 7?
I'm making a selection of users from the database, I want to set a condition: depending on the selected value in the field I added with a checkbox for the user, display only users in which field value [1]
Now I just display all users, except for those who have the "Blocked" status
$q = db_select('users', 'u');
$q->fields('u', array('uid'))
->condition('status', 0, '!=');
$r = $q->execute()->fetchAll();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question