#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    3
    Rep 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 03:39 PM.
  2. #2
  3. Moderator Emeritus
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Austin, TX
    Posts
    7,188
    Rep Power
    2265
    Post the code you're using - it will help other users determine if the error is w/ your CFML or somewhere else.

    Thanks.
    DrGroove, Devshed Moderator | New to Devshed? Read the User Guide | Connect with me on LinkedIn
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    3
    Rep 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.
  6. #4
  7. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,286
    Rep Power
    968
    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.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    3
    Rep Power
    0
    switched the insert statement to and actual insert SQL statement and made a huge difference. Thanks for the pointer on that one.

IMN logo majestic logo threadwatch logo seochat tools logo