SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    select using <cfqueryparam> not working

    Can someone please help me figure out why select 1 is not working?

    The form.chkemail is popultated by clicking on a checkbox located on the form before this page.

    Here is the form tag:
    Code:
    <cfform name="delete_multi" method="post" 
    action="clients_delete_multi.cfm">
    Here is the checkbox:
    Code:
    <cfinput type="checkbox" name="chk_email" 
    value= "<cfoutput>#getclients.email#</cfoutput>" />
    Here are the selects:
    Code:
    <cfoutput> emails from form: #form.chk_email#</cfoutput>
    					 
    					 	 
    <cfquery name="delclients" datasource="newsletter">
    						
    select email from #guests# where email in 
    (<cfqueryparam value="#form.chk_email#" list="true" 
    cfsqltype="cf_sql_varchar">)
    </cfquery>
    						
                           
    <cfoutput query="delclients"> emails from select 1: 
    #delclients.email#</cfoutput>
    					   
    					   
                       
    <cfquery name="selectclients" datasource="newsletter" 
    debug = "yes" result = "selclients_result">
    						
    select email from #guests# where email in 
    ('21312@fasdf.com','test@test.com')
    															
    </cfquery>
    <cfoutput query="selectclients"> emails from select2: 
    #selectclients.email#</cfoutput>
    I get results form select 2 but nothing from select1 as if it never happened.
    Also the output for the form looks like this:
    emails from form: 21312@fasdf.com,test@test.com
    emails from select2: test@test.com
    emails from select2: 21312@fasdf.com

  2. #2
    SitePoint Wizard bronze trophy cydewaze's Avatar
    Join Date
    Jan 2006
    Location
    Merry Land, USA
    Posts
    1,096
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Ok, with the disclaimer that I'm pretty much a newb, I don't think you need the <cfoutput> tags in a <cfinput> tag. I think you only need those if you're using a regular <input>

    Also, you mentioned having trouble with <cfqueryparam> but I don't see any of those in your code, so I can't tell where you might be having a problem with it.

  3. #3
    SitePoint Member
    Join Date
    Sep 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the issue was the way I added the checkboxes in the value = "<output>"

    I removed that and it is working nicely now.

    Thanks for your help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •