$users = db_select('users')
->fields('users')
->condition('name', db_like('admin'), 'LIKE')
->condition('status', 1)
->orderBy('name')
->execute()
->fetchAll();
foreach($users as $key=>$value){
echo $value->uid.",";
}
?>
outputs like(displays uid) : 1
No comments:
Post a Comment