Re: string compare

2004-06-16 Thread SGreen
I see several problems with your statement: 1) "substr" should be "substring" (see http://dev.mysql.com/doc/mysql/en/String_functions.html) 2) "where name like '%' " means that name can have from 0 to any number of characters. Basically it's a match on anything other than NULL. If name is a field

Re: string compare

2004-06-16 Thread gerald_clark
Bob Lockie wrote: Where is the syntax error in this? select name from users where name like '%' and strcmp( substr(name from 1 for 3), 'abc' )=0; substr(name,1,3) Check the manual. You don't include the 'from' and 'for'. Why should I use strcmp since "MySQL automatically converts numbers to str

Re: string compare problem with single quote in string

2002-06-25 Thread Victoria Reznichenko
testacct, Monday, June 24, 2002, 3:37:37 PM, you wrote: t> I am comparing songnames from two tables to find a match. t> My query looks like this: t> $querymvideo = "select movietable.id, movietable.songname t> from movietable where TRIM(movietable.songname) LIKE t> '__$foo' "; t> The above quer