Re: mysql - SUBSTRING

From: Date: Sat, 12 May 2001 08:33:19 +0000
Subject: Re: mysql - SUBSTRING
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52553@lists.php.net to get a copy of this message
In article <000c01c0dabb$422d2bd0$01000001@devel01>, myviva@utanet.at ("andreas \(@work\)") wrote: > but i cant work it out how to use this function in the WHERE clause > > ... WHERE SUBSTRING(field,pos,len) LIKE "ABC" > ... WHERE SUBSTRING(field,pos,len) = 'ABC' > ... WHERE SUBSTRING(field,pos,len) LIKE 'ABC' > > none of them work Hard to say what's wrong without actual an actual query to look at, nor info on what error (if any) MySQL is reporting. Though perhaps as a point of reference, do note that use of the "like" keyword should usually be accompanied by a wildcard character, usually the "%": like "ABC%" like "%ABC" like "%ABC%" etc. IOW, "LIKE" without wildcards is the same as using the "=" comparison operator. -- CC

« previous php.general (#52553) next »