The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> ColdFusion Development
|
Data not writting to db
Discuss Data not writting to db in the ColdFusion Development forum on Dev Shed. Data not writting to db ColdFusion Development forum discussing CFML coding practices, tips on CFML, and other CFML related topics. Find out why ColdFusion is the tool of choice for many e-commerce developers.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 6th, 2003, 12:50 PM
|
|
Junior Member
|
|
Join Date: Oct 2003
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Data not writting to db
I have kind of an odd problem. When I submit a form, the data randomly doesn't write to the database. It sticks around long enough for me to validate that indeed information was imputed and is correct, but on the submition to the db, it is lost. It does it with random fields at random times. It doesn't seem to make a difference if I have default values or not.
An example of it is I have a Yes/No question with a comment box. If you answer No with no comment, it directs you to fill in the comment, that part works, but the answer to the Yes/No isn't always written to the db. Other times it is. I also have run into this problem with an address field. Sometimes it writes the address, other times it doesn't.
Any of you have any ideas on what would be causing this?
Thanks-
Here is the code for the input:
<td>Yes <input type=radio name="english_improve" value="Yes"></td><td>No<input type=radio name="english_improve" value="No" checked>
If the error checking is ok:
<CFtransaction action="begin" isolation="serializable">
<CFINSERT DATASOURCE="reports" TABLENAME="test_progress_reports">
Had the same problem before the error checking was there, so the problem isn't in that.
The address problem input looks like this: <INPUT type="text" name="school_Add" value="#sch_Add#" size=30></INPUT> same type of insert tag. The address is pulled from a different db, if its available, if not, the user enters it. Either way it doesn't always take.
Last edited by rahljosh : October 6th, 2003 at 02:39 PM.
|

October 6th, 2003, 02:31 PM
|
 |
Moderator Emeritus
|
|
Join Date: Feb 2002
Location: Scottsdale, AZ
|
|
Post the code you're using - it will help other users determine if the error is w/ your CFML or somewhere else.
Thanks. 
|

October 6th, 2003, 03:43 PM
|
|
Junior Member
|
|
Join Date: Oct 2003
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Here is the code for the input:
<td>Yes <input type=radio name="english_improve" value="Yes"></td><td>No<input type=radio name="english_improve" value="No" checked>
If the error checking is ok:
<CFtransaction action="begin" isolation="serializable">
<CFINSERT DATASOURCE="reports" TABLENAME="test_progress_reports">
Had the same problem before the error checking was there, so the problem isn't in that.
The address problem input looks like this: <INPUT type="text" name="school_Add" value="#sch_Add#" size=30></INPUT> same type of insert tag. The address is pulled from a different db, if its available, if not, the user enters it. Either way it doesn't always take.
|

October 6th, 2003, 10:40 PM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
What database are you using? Are you sure it supports the "serializable" transaction mode?
Also, the use of CFINSERT is fraught with peril. It takes a little more work, but trust me and write out a SQL insert statement instead, things will work much more smoothly if you do.
|

October 8th, 2003, 01:37 PM
|
|
Junior Member
|
|
Join Date: Oct 2003
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
switched the insert statement to and actual insert SQL statement and made a huge difference. Thanks for the pointer on that one.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|