|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
Post the code you're using - it will help other users determine if the error is w/ your CFML or somewhere else.
Thanks. ![]()
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
switched the insert statement to and actual insert SQL statement and made a huge difference. Thanks for the pointer on that one.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Data not writting to db |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|