This is what I have now:

```
 function getAlbum(){
     $args = func_get_args();

     if(!(count($args) % 2) || count($args) == 1) {
         trigger_error('Argument count must be an odd number and greater than one.');
         return false;
     }

     $q = new Query("album_manager");
     $q->select($args[0]);
     unset($args[0]);
     call_user_func_array(array($q, "where"),$args);
     $q->limit(1);
     return send_back_as_array($q);
 }

```

If you call `getAlbum('*','cid',1)` you get all attributes where `cid=1`  

If you call `getAlbum('cid, anchor', 'cid',1)` you get the `anchor` and `cid` where `cid=1`

It works fine, except I am worried that when someone is debugging the code, they might mistake the `,` between `cid` and `anchor` for an argument separator and get confused.

Does anyone have a more elegant solution? I am just interested.

I thought about changing it to where it accepts `getAlbum('cid','anchor','where:','cid',1)` but I'm not sure that will be any better.

This is what I changed it to:

```
function getAlbum(){
    // argument one is a comma separated value or an array of what is requested.
    // the rest of the args must be an even number (odd number of args overall)
    // ever even argument is a selector and every odd is a condition 'selector = condition' in query
    // Examples:
    //      getAlbum('*','cid',1);   <-  Select all attributes from album where cid = 1
    //      getAlbum('cid','anchor','test','name','This is a test'); <- select cid from album where anchor = 'test' and 'name' = 'This is a test'
    //      getAlbum(array('cid','anchor'),'test','name'); select cid and anchor where 'test'='name'
    //      getAlbum('cid, anchor','cid',1); select cid and anchor where cid=1
    $args = func_get_args();
    if(!(count($args) % 2) || count($args) == 1) {
        trigger_error('Argument count must be an odd number and greater than one.');
        return false;
    }
    $q = new Query("album_manager");
    $q->select((is_array($args[0]) ? implode(", ",$args[0]) : $args[0]));
    unset($args[0]);
    call_user_func_array(array($q, "where"),$args);
    $q->limit(1);
    $array = send_back_as_array($q);
    if(count($array) != 1) return false;
    else return $array;
}

```