• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Simple coldfusion update query

exel

n00b
Joined
Jan 21, 2006
Messages
48
Hello,

I can't seem to get my update query to "check" a yes/no access database field. It's probably something really simple that I am missing.

Here's the fields that I have on the database side:

Code:
id  AUTONUMBER
name  TEXT
userNo  NUMBER
agreed  YES/NO

On the coldfusion page I have the following query: Notice the form.varNames are coming from a previous form where user typed in the information

Code:
<CFQUERY NAME="userInfo" DATASOURCE="user">

UPDATE t_User 
SET name = '#form.name#', 
userNo = '#form.userNo#', 
agreed = '#form.agreed#',
WHERE user.id = #form.id#;

</CFQUERY>

So the problem is that the code will not update the 'agreed' field inside the database. Any suggestions/ideas/hints/help?

Thank you in advance.
 
while your sql look correct, I'd look for database specific sql for access yes/no

also you really should be using cfqueryparam instead of straight variable names.
 
while your sql look correct, I'd look for database specific sql for access yes/no

also you really should be using cfqueryparam instead of straight variable names.

Yeah, the sql code was correct, the problem turned out to be that it was never running that update query. I had session variable problems :eek:

Anyways, after a bit of reading/googling I decided to use cfqueryparam from now on.

Cheers!
 
You should dump the queryparams, and use stored procedures, that is the best way to work it.
 
Back
Top