Thomas,

Just occurred to me, try %% instead.

Justin
--
t: CEO/CTO buddyPing
e: justin@buddyping.com
m: 07833 530876


On 28 Nov 2005, at 15:24, Thomas G. Willis wrote:

I bet it's escaping the percent sign. anyone know of a way to control that?

I'm doing this on the cvs version forgot to mention that?


On 11/28/05, Justin Davies <justin@buddyping.com> wrote:
Thomas,

Not a huge amount of help, but may give you some pointers:

Get the devel module and turn on query output.  You will be able to see exactly what is being sent to the database.

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%.
Justin
--
t: CEO/CTO buddyPing
m: 07833 530876


On 28 Nov 2005, at 14:44, Thomas G. Willis wrote:

I apologize if this isn't the right list. didn't know if this would be support necessarily since it's a custom module.

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.
I can't get a query working using the like operator in drupal. the same sql runs fine in in phpmyadmin.

not like will return results though weird. any ideas?
 
function _db_getartistlist($filter=''){
//Example $filter='A%';
/*filter not working yet ??*/

/*doesn't work*/
/*
if($filter!=''){
return db_query('select distinct artist from {mp3col_data} where artist like \'' .$filter . '\' order by artist');

//return db_query('select distinct artist from {mp3col_data} where artist like \'%s\' order by artist',$filter);

}else{
return db_query('select distinct artist from {mp3col_data} order by artist');

}
*/

/*works*/
return db_query('select distinct artist from {mp3col_data} order by artist');
}


--
Thomas G. Willis
-----------------------------------------------
http://i-see-sound.com
http://tomwillis.sonicdiscord.com






--
Thomas G. Willis
-----------------------------------------------
http://i-see-sound.com
http://tomwillis.sonicdiscord.com