Computer problems,Computer help
*AX SOFT>>>Programming & Design

SQL Query in coldfusion?


Ok, Basically in my .cfm page that handles the processing of a registration from I have the code to send an email, But I need to pull the users email from the database which means I need to use a variable in the where clause to get it. Here is an example of what I mean

<cfquery name="rs4" datasource="foliobox">

SELECT EMAIL FROM SITE_USER
WHERE userid = #newID#

</cfquery>

This however does not work. newID is the id that gets put in the database for the user when they sign up. Any ideas?

After some more debugging the error that is coming up is not to do with newID. The error reads simply

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' SELECT EMAIL FR' at line 1"


newID is coming from earlier in the page
<cfset newID = (#rs.userid# + 1)>

To debug newId I printed it out and it came out fine, one number higher than the last entry in the database

Where are you getting your #newID# variable from?

Session
QueryString
Cookie
Object

Double check it!

Test your query?
Make Sure your dataconnection is not lost?

Really need more infor then this to trouble shoot. Post the entire code.

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • How can I make my own website with only .com for free???

    1 registration 2 copy right 3 $$$$ depends on you web content 4 sponsors 5 clients 6 u got you web

    ...
  • My SQL is free or not? If cost mean how much?

    Basic MySQL database engine is free, however there is also "Enterprise" edition, which is not free. It has total cost of ownership of $18,000 per year for 6 servers according to their we...

  • What website can I use?

    try www.hidemytrace.com

    ...
  • Can I do this in TSQL?

    you dont need the ) after the "2" you also might want to put parentheses around each part of the if like: If (@PhoneID = @PrevphoneID) and ()

    ...
  • PLEASE HELP! How do you add a comment box and have the comments sent to your email in Dreamweaver 8?

    First of all WARNING! DANGER! A properly designed comment box is a highly complex piece of software. Why? A comment box is two parts. (1) The web form that you design in Dreamweaver, along...

  • I need serious help with Java!?

    Flow charts for programming are usually a graphical representation of objects. (Sorry about the spacing problems, it seems I can't give you cleaner code with indentions and what not - ignore ...

  • I'm having problems making a calculator with Javascript?

    If you want to you can copy and paste your code into an email and i can try and help you out

    ...
  • What about CSS file size?

    30KB is pretty large. Try to separate your stylesheets into sections, and only make the browser call them when it's needed (e.g., only call the "search" stylesheet when a user perfo...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster