This content has been marked as final. Show 4 replies
What are you looking for the like clause to be?
e.g. LIKE 'B' or LIKE 'BAG'
> I a looking into something that can match my String value.
So many issues in one little post.
Lets start with the getNameInitials() function. It apparently returns a
simple string of the first letters of all the words of the string passed
into it. Using your example it is going to return 'BAG'.
I'm not sure why you need all of that. If you just want the first
letter of the sting, 'BLONDE AND GIRL' it would be simply be
left('BLONDE AND GIRL',1).
Secondly your LIKE statement is missing quotes and percents it should
read something as LIKE 'left(arguments.title,1)%' or however you want to
pattern match the database field.
Finally, if arguments.title is undefined or an empty string then you
will have a hanging where clause. Your SQL will be rendered as:
SELECT jokes.*, categories.*
INNER JOIN categories ON jokes.catID = categories.catID
And this will throw an error by any database I have ever used.
Ian Skinner wrote:
> Secondly your LIKE statement is missing quotes and percents it should
> read something as LIKE 'left(arguments.title,1)%' or however you want to
> pattern match the database field.
I forgot the pound signs in my first post.
Of course the standard recommendation to learn and use <cfqueryparam...>
in your SQL stands.
I am so big fool, how i forgot this small little function
Thanks GUys Cheeers