More help with DB deletion

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default More help with DB deletion

    3 pages. Input of primary keys on page 1. checking to make sure primary keys
    match, and display data to be deleted on page 2. Deletion of data on page 3.
    Problem exists on page three. Below is the error that comes back from the cold
    fusion server. The code is pasted further below if you need to look at it.
    Thank you. And thank you Phil for helping me the first time, it seemed to of
    worked but now I have this other problem. Thanks.

    Bob


    The following error occurs:

    Error Occurred While Processing Request
    Error Diagnostic Information

    An error occurred while evaluating the expression:


    #FORM.P_Num#



    Error near line 9, column 35.

    --------------------------------------------------------------------------------

    Error resolving parameter FORM.P_NUM


    The specified form field cannot be found. This problem is very likely due to
    the fact that you have misspelled the form field name.



    The error occurred while processing an element with a general identifier of
    (#FORM.P_Num#), occupying document position (9:34) to (9:45).




    delete_roster1.cfm

    <html>
    <head>
    <title>Delete Roster</title>
    </head>

    <body bgcolor="ffffff">
    <form action="delete_roster2.cfm" method="post">
    <font face="Trebuchet MS, Arial, Helvetica" color="330099">
    <table align="center" width="400">
    <caption>
    <h3><font color="ff7300">Delete Roster - Site Admin Tool</h3><hr>
    <h3><font color="ff7300">Delete a Member</h3>
    </caption>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td>Step 1.</td>
    <td>Enter P00 Number Here: <input type="text" name="P_Num" value="P00"></td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td>Step 2.</td>
    <td>Enter P00 Number Again: <input type="text" name="P_Num2" value="P00"></td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td>Step 3.</td>
    <td><input type="submit" value="Continue >>>"></td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr><td colspan="2">Warning: Deleted records are lost forever.</td></tr>

    </table>
    </font>
    <hr align="center" width="400">
    </form>
    </body>
    </html>



    delete_roster2.cfm

    <html>
    <head>
    <title>Delete Member Screen 2</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <cfif FORM.P_Num NEQ FORM.P_Num2>
    <font color="ff7300">Team Member verification failed. Go <a
    href="delete_roster1.cfm">back</a> and try again.
    <cfelse>
    <form action="delete_roster3.cfm" method="post">
    <cfquery datasource="Trackclub" name="getInfo">
    Select * From roster
    Where P_Num = '#P_Num#'
    </cfquery>
    <cfloop query="getInfo">
    <cfoutput>
    <table align="center" width="400">
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Last Name: </td>
    <td> #LName# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> First Name: </td>
    <td> #FName# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> P00 Number: </td>
    <td> #P_Num# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Date of Birth: </td>
    <td> #dob# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Class: </td>
    <td> #class# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Sex: </td>
    <td> #sex# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> School Phone Number: </td>
    <td> #School_Phone# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> School Street Address: </td>
    <td> #school_street# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> School City: </td>
    <td> #School_city# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> School State: </td>
    <td> #School_state# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> School Zip Code: </td>
    <td> #School_zip# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> BG Email Address: </td>
    <td> #BG_Email# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Home Phone Number: </td>
    <td> #home_Phone# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Home Street Address: </td>
    <td> #home_street# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Home Town: </td>
    <td> #home_city# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Home State: </td>
    <td> #Home_state# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Home Zip Code: </td>
    <td> #home_zip# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Cell Phone Number: </td>
    <td> #Cell_phone# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Height: </td>
    <td> #height# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Weight: </td>
    <td> #Weight# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> High School: </td>
    <td> #high_school# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Events: </td>
    <td> #events# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td><input type="submit" value="Yes Delete >>>"></td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Wrong Information -- Go <a href="delete_roster1.cfm"> BACK</a>. </td>
    </tr>
    </table>
    </cfoutput>
    </cfloop>
    </form>
    </cfif>
    </body>
    </html>



    delete_roster3.cfm

    <html>
    <head>
    <title>Delete Team Member Screen 3</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <cfquery datasource="Trackclub">
    DELETE FROM roster WHERE P_Num = '#FORM.P_Num#'
    </cfquery>
    <font color="ff7300">Data deleted successfully. Click <a
    href="BGTrack_admin.cfm">here</a> to return to the Site Admin Tool.

    </body>
    </html>


    THANKS AGAIN!!


    Student_bob Guest

  2. Similar Questions and Discussions

    1. PREVENTING CSS DELETION
      Hello, There is an option at the bottom of the CSS style list in Contribute, to remane or delete CSS styles. How do I configure Contribute to...
    2. Help with database deletion
      we have the below 3 pages. delete_roster1, 2, 3.cfm from delete1 we have the user input two id fields, they are assigned to 2 different...
    3. Bookmarks deletion
      using Adobe Acrobat 5.0 on windows pc I am new to creating pdfs however, I created a 39 page pdf with several bookmarks. I need to update this...
    4. [PHP] File upload and deletion
      Steven Murphy <mailto:list@pfohlsolutions.com> on Thursday, August 21, 2003 1:40 PM said: Are you wanting me to download this file, unzip it,...
    5. Deletion problems
      I am having two similar issues, and if I can figure one out, I might be able to figure out the other. a while back, I had a file that I couldn't...
  3. #2

    Default Re: More help with DB deletion

    How are you getting the variable FORM.P_Num from delete_roster2.cfm to
    delete_roster3.cfm? You need to add an <input> tag of type="hidden" named P_Num
    with the value of FORM.P_Num on delete_roster2.cfm so that when you submit the
    form, the form variable is forwarded to delete_roster3.cfm.

    Phil

    paross1 Guest

  4. #3

    Default Re: More help with DB deletion

    We've tried this and it says the record has been deleted but when we check the
    database it does not delete it. No error messages just runs the code, but
    doesn't delete

    delete_roster2.cfm

    <form action="delete_roster3.cfm" method="post">
    <input type="hidden" name="P_Num" value= '#form.P_num#'>


    delete_roster3.cfm

    <cfquery datasource="Trackclub">
    DELETE FROM roster WHERE P_Num = '#form.P_Num#'
    </cfquery>



    We believe the error is in delete_roster2.cfm value= '#form.P_num#'

    because when we put the primary key hard coded it works.

    Student_bob Guest

  5. #4

    Default Re: More help with DB deletion

    The hidden input tag should be within a set of cfoutput tags (I would put it
    with your SUBMIT input tag). Also, not that it makes a difference in this case,
    but you should use double quotes around "#form.P_num#" in your hidden input,

    delete_roster2.cfm

    <html>
    <head>
    <title>Delete Member Screen 2</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <cfif FORM.P_Num NEQ FORM.P_Num2>
    <font color="ff7300">Team Member verification failed. Go <a
    href="delete_roster1.cfm">back</a> and try again.
    <cfelse>
    <form action="delete_roster3.cfm" method="post">
    <cfquery datasource="Trackclub" name="getInfo">
    Select * From roster
    Where P_Num = '#P_Num#'
    </cfquery>
    <cfloop query="getInfo">
    <cfoutput>
    <table align="center" width="400">
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Last Name: </td>
    <td> #LName# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> First Name: </td>
    <td> #FName# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> P00 Number: </td>
    <td> #P_Num# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Date of Birth: </td>
    <td> #dob# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Class: </td>
    <td> #class# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Sex: </td>
    <td> #sex# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> School Phone Number: </td>
    <td> #School_Phone# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> School Street Address: </td>
    <td> #school_street# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> School City: </td>
    <td> #School_city# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> School State: </td>
    <td> #School_state# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> School Zip Code: </td>
    <td> #School_zip# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> BG Email Address: </td>
    <td> #BG_Email# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Home Phone Number: </td>
    <td> #home_Phone# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Home Street Address: </td>
    <td> #home_street# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Home Town: </td>
    <td> #home_city# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Home State: </td>
    <td> #Home_state# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Home Zip Code: </td>
    <td> #home_zip# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Cell Phone Number: </td>
    <td> #Cell_phone# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Height: </td>
    <td> #height# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Weight: </td>
    <td> #Weight# </td>
    </tr><tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> High School: </td>
    <td> #high_school# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Events: </td>
    <td> #events# </td>
    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td><input type="submit" value="Yes Delete >>>"></td>
    <input type="hidden" name="P_Num" value= "#form.P_num#">

    </tr>
    <tr><td colspan="2"><hr></td></tr>
    <tr>
    <td> Wrong Information -- Go <a href="delete_roster1.cfm"> BACK</a>. </td>
    </tr>
    </table>
    </cfoutput>
    </cfloop>
    </form>
    </cfif>
    </body>
    </html>

    Phil


    paross1 Guest

  6. #5

    Default Re: More help with DB deletion

    Thank you so much, I appreciate it Phil.

    Have a good one.

    Bob
    Student_bob Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139