macromedia.coldfusion.advanced_techniques
[Top] [All Lists]

Re: A Little Coldfusion help?

Subject: Re: A Little Coldfusion help?
From: Ian Skinner
Date: Tue, 18 Nov 2008 09:38:09 -0800
Newsgroups: macromedia.coldfusion.advanced_techniques


nightwolf666 wrote:
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.*
 FROM
 jokes
 INNER JOIN categories ON jokes.catID = categories.catID
 WHERE

And this will throw an error by any database I have ever used.

<Prev in Thread] Current Thread [Next in Thread>