Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8153695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:06:20+00:00 2026-06-06T16:06:20+00:00

For example what do the around #Trim(FORM.fromfirstname)# do? I’m adding <cfqueryparam…> tags and am

  • 0

For example what do the “” around #Trim(FORM.fromfirstname)# do? I’m adding <cfqueryparam...> tags and am wondering if the quotes are still required?

<CFQUERY NAME="account" DATASOURCE="#APPLICATION.centralDSN#">
    SELECT * 
    FROM users
    WHERE (firstname =<CFQUERYPARAM VALUE="#Trim(FORM.fromfirstname)#">)
        AND (lastname = <CFQUERYPARAM VALUE="#Trim(FORM.fromlastname)#">)
        AND (email = '#Trim(FORM.fromemail)#')
</CFQUERY>

Here’s one that doesn’t use quotes for the WHERE clause:

<CFIF getUser.RecordCount>
    <CFQUERY NAME="cUser" DATASOURCE="#APPLICATION.centralDSN#">
        UPDATE users
            SET mailing_list = <CFIF IsDefined("FORM.mailing_list")>#FORM.mailing_list#<CFELSE>0</CFIF>
        WHERE user_id = #getUser.user_id#
    </CFQUERY>
</cfif>

EDIT: if they don’t do anything there’s no harm in keeping them, correct? In another file I found examples like

    to="#ListFirst(EnglishEmailList)#"
    cc="#ListRest(EnglishEmailList)#"

So if they are already there I’ll leave them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:06:21+00:00Added an answer on June 6, 2026 at 4:06 pm

    SQL needs quotes for strings.

    Quotes are part of standard SQL syntax to indicate a string (as indeed they are in almost every language).

    If it didn’t have quotes then SQL parser would have no idea where the string ended and the SQL continued.

    Quotes are not necessary for numbers – where there is no ambiguity about where the value ends.

    Remember also that the #hashes# are nothing to do with SQL – they are entirely on the CFML side. When running the cfquery tag, CF evaluates the body (including any hash expressions it contains) to create an SQL string, which is then passed to the database, (along with additional settings/parameters/etc). The SQL server has no knowledge of what parts of that string was hard-coded and what parts might have been evaluated from hashes.

    cfqueryparam doesn’t need quotes.

    When you’re fixing the queries to use cfqueryparam, you are creating parameters, and the tag handles everything necessary to indicate strings/etc to the SQL database. (You never need to wrap the cfqueryparam tag itself in quotes.)

    Within the cfqueryparam tag, it makes zero difference whether or not you use quotes for the attributes – these three all produce the same result:

    <cfqueryparam value="#var#" />
    <cfqueryparam value='#var#' />
    <cfqueryparam value=#var# />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example: http://g.co/maps/2dpkj has the outline around the postcode area. I understand this is
Anyone have an minimal example of ASP.NET MVC and dotnetcharting.com control lying around? Thanks,
I'm playing around with the html5 contentEditable=true feature. The best example therefor is here
Consider the example plot below. I'd like to make the little boxes around each
I am playing around with xpath, but have no Idea how to for example
Input: $string = this-is-just-an--example Output: this is just an-example Tried various things centered around
I need to get the IDs around an ID with mySQL. Example: IDs ​​in
I have a long list of names that I need to have quotes around
I can't get my head around a solid RegEx for doing this, still very
I have been trying to set up a baisc calendar example to play around

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.