Query Drupal User Table for: date created < $today - '100000' I would like to select users from the Drupal users table where the date created was older than 1 day ago. Then delete those users. This code isn't correct but it will give you an idea of what I am trying to do I just don't know the right DB query. '

$users = db_select('user', 'created') //I know this is not the right DB query  
$count = count($users);
if($count &gt; 0){
  $users = user_load_multiple(array_keys($users['user']));
}
$today = getdate(); 
if ($users &lt; $today - '100000' ) {
 user_delete($user-&gt;uid)
}


I am thinking about using user_load_multiple() to load the users in to an array to perform the delete action.
You can achieve this using EntityFieldQuery as shown below:

$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'user')
  -&gt;propertyCondition('created', strtotime("-1 day"), '&lt;')
  -&gt;propertyCondition('uid', array(0,1), 'NOT IN');
$result = $query-&gt;execute();
if(!empty($result)){
    user_delete_multiple(array_keys($result['user']));
}