<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Thomas,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>Not a huge amount of help, but may give you some pointers:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Get the devel module and turn on query output.  You will be able to see exactly what is being sent to the database.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The other thing is that db_query *might* be escaping the % character so it will never return a result unless you have an artist starting with A%.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Justin<BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>--</DIV><DIV>t: CEO/CTO buddyPing</DIV><DIV>e: <A href="mailto:justin@buddyping.com">justin@buddyping.com</A></DIV><DIV>m: 07833 530876</DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR><DIV><DIV>On 28 Nov 2005, at 14:44, Thomas G. Willis wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">I apologize if this isn't the right list. didn't know if this would be support necessarily since it's a custom module.<BR> <BR> I'm at a loss as to whether this is a bug or whether I'm just trying to do something I'm not supposed to.<BR> I can't get a query working using the like operator in drupal. the same sql runs fine in in phpmyadmin.<BR> <BR> not like will return results though weird. any ideas? <BR>  <BR> <PRE>function _db_getartistlist($filter=''){<BR>//Example $filter='A%';<BR>/*filter not working yet ??*/<BR><BR>/*doesn't work*/<BR>/*<BR>   if($filter!=''){<BR>      return db_query('select distinct artist from {mp3col_data} where artist like \'' .$filter . '\' order by artist');
<BR>      //return db_query('select distinct artist from {mp3col_data} where artist like \'%s\' order by artist',$filter);<BR><BR>   }else{<BR>      return db_query('select distinct artist from {mp3col_data} order by artist');
<BR>   }<BR>*/<BR><BR>   /*works*/<BR>   return db_query('select distinct artist from {mp3col_data} order by artist');<BR>}<BR></PRE> <BR clear="all"><BR>-- <BR>Thomas G. Willis<BR>-----------------------------------------------<BR><A href="http://i-see-sound.com">http://i-see-sound.com</A><BR><A href="http://tomwillis.sonicdiscord.com">http://tomwillis.sonicdiscord.com </A><BR><BR><BR></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>