1a2
> // $Id: nodequeue.module,v 1.116 2011/01/05 06:13:22 ezrag Exp $
1897a1899,1900
>     $count = 0;
>     $parms_array = array();
1900c1903
<       if ($where) {
---
>       if ($count > 0) {
1903,1904c1906,1911
<       $where .= 's.qid = :qid AND s.reference IN (:reference)';
<       $query->where($where, array(':qid' => $qid, ':reference' => $reference));
---
> 
>       $where .= '(s.qid = :qid'.$count.' AND s.reference IN (:reference'.$count.'))';
>       $parms_array[':qid'.$count] = $qid;
>       $parms_array[':reference'.$count] = $reference;
> 
>       $count++;
1905a1913,1914
> 
>     $query->where($where, $parms_array);
