Ask a Question related to Coldfusion Database Access, Design and Development.
-
loofa #1
whats wrong with my sql?
ok, is what i'm doing here is insert a few fields into a table, which works
fine. then i'm trying to query the table using the same email address that i
used to make the new row to get the quto number made in that row "userid"
now its not giving my any errors but when i pass the variable "id" through the
url its ending up with nothing being in it "id= "
that must meen that nothing is being found in the query..... why?
Thank you for taking a look,
Tommy
<cfif not isdefined("form.email")>
<cflocation url="login.cfm">
</cfif>
<cfinsert datasource="c8k" tablename="useraccounts">
<cfquery name="getid" datasource="c8k">
select userid
from useraccounts
where '%#form.email#%' = email
</cfquery>
<cflocation url="setupcomplete.cfm?id=#getid.userid#">
loofa Guest
-
hmm whats wrong ??
I will try to explain from scratch: I use dreamweaver 8 I have installed the media server 2 in this directory: ... -
Anyone know whats wrong with this?
hi all, I have a form with a text box and a checkbox. If the text box is empty the page retreives records based on this text and if the check box... -
im just about to give uo, whats wrong!!!
yesterday i submitted a post about a pop up window, i got that fixed, dont no how, and ive gone to modify the pop up window, and did change nething,... -
[PHP] Whats wrong?
Hey, Just touched it up a bit but its working: <title> <?php $senderemail = $_POST; print "Thank You, $senderemail"; ?> </title> -
Whats wrong with this code?
Ray, This is the wrong syntax for the CASE expression. There are two valid kinds of CASE expression: CASE <expression> WHEN <value 1> THEN... -
mxstu #2
Re: whats wrong with my sql?
Originally posted by: loofa
select userid
from useraccounts
where '%#form.email#%' = email
You shouldn't be using percent signs "%" here. In most databases the "%" sign
is used as a wildcard to find partial matches on text fields. It is used in
conjunction with the LIKE operator, not the equals "=" operator. For example,
you might use a wildcard to find records in a table where the last name begins
with the letters "MAL", like ....
SELECT FirstName,LastName FROM myTable WHERE LastName LIKE 'MAL%'
Since you want to retrieve the record where the email matches exactly, you
should use the equals operator "=" (without the percent signs). Note:
Typically, the comparison value is placed on the right hand side of the
operator not the left.
select userid
from useraccounts
where email = '#form.email#'
Originally posted by: loofa
ok, is what i'm doing here is insert a few fields into a table, which works
fine. then i'm trying to query the table using the same email address that i
used to make the new row to get the quto number made in that row "userid"
now its not giving my any errors but when i pass the variable "id" through the
url its ending up with nothing being in it "id= "
that must meen that nothing is being found in the query
You should probably add some validation/error handling to your page to ensure
that A) the email address is not added more than once and B) an error message
is displayed if the "getid" query returns no information.
Good Luck
mxstu Guest
-
-



Reply With Quote

