Why won't this delete???

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Why won't this delete???

    My problem is that this code was previously used, but it does not work now. I
    think it may be because I have so many url variables. Any ideas? It's just
    supposed to delete the record thats output in that row based on the id.

    <cfif isdefined("url.action") and isdefined("url.season") and
    isdefined("url.page") and isdefined("url.id")>
    <cfset display = "1">
    <cfif url.action eq "<cfoutput>#userid#</cfoutput>" and url.season eq
    "<cfoutput>#season#</cfoutput>" and url.page eq "del" and isdefined("url.id")>
    <cfquery name="delete" username="sla" password="slaera" datasource="sla">
    delete FROM login_adm WHERE id = '#url.id#'
    </cfquery>
    <script>
    window.location="yahoo.com";
    </script>
    </cfif>
    </cfif>

    <table width="100%" border="1" cellpadding="2" cellspacing="2">
    <tr>
    <td colspan="5" class="leaguename">Sub-Admin Login Modifications </td>
    </tr>
    <tr class="coolblue">
    <td width="26%"><div align="center">Personal Name </div></td>
    <td width="26%"><div align="center">Username</div></td>
    <td width="26%"><div align="center">Password</div></td>
    <td width="10%"><div align="center">Edit</div></td>
    <td width="10%"><div align="center">Delete</div></td>
    </tr>
    <cfoutput query="checklogin">
    <tr class="maintext">
    <td width="26%"><div align="center">#name#</div></td>
    <td width="26%"><div align="center">#login#</div></td>
    <td width="26%"><div align="center">#login_passwd#</div></td>
    <td width="10%"><div align="center"><a
    href="sub-admin-add.cfm?action=#url.action#&season=#url.season#&ed itid=#login_id
    #">[Edit]</a></div></td>
    <td width="10%"><div align="center"><a
    href="sub-admin.cfm?action=#url.action#&season=#url.season#& page=del&id=#login_i
    d#">[Delete]</a></div></td>
    </tr>
    </cfoutput>

    weswhite7 Guest

  2. Similar Questions and Discussions

    1. delete FLV again
      :confused; Hello all, I'm having a trouble of calling the server side to delete the selected file from a list box. here is what I have on the...
    2. Delete form - Post data to a table and delete uponsubmit.
      I have a delete form that I'd like to post the data to a table (delete_pcn) and delete upon submit, so that all deletions may be kept track of in...
    3. Delete button to delete 3D model
      Hi all I'm new to director and I'm doing a 3D room planner project. For this application user can design their room virtually with 3D models of...
    4. Delete key doesn't delete when datagrid is bound to a disconnected table
      (Re: WinForm Datagrid) I manually built a table instead of filling it from a datasource. I bound my datagrid to the table. The datagrid works great....
    5. How to delete a LUN?
      On Mon, 18 Aug 2003 14:00:59 -0700, Gerardo Colón wrote: You need to go into the Specialist and unassign the LUN from the target HBA(s). You...
  3. #2

    Default Re: Why won't this delete???

    You must not use <cfoutput> in situations like this. And you shouldn't use #
    signs either, since you're not trying to _output_ anything. If your #userid#
    was "7" for example, you're comparing if url.action equals
    "<cfoutput>7</cfoutput>", not "7".

    Change

    <cfif url.action eq "<cfoutput>#userid#</cfoutput>" and url.season eq
    "<cfoutput>#season#</cfoutput>" and url.page eq "del" and isdefined("url.id")>

    to:

    <cfif url.action EQ userid AND url.season EQ season AND url.page EQ "del" AND
    isDefined("url.id")>

    (just capitalized operators for clarity)

    You're not trying to _output_ anything on the screen. So do not use <cfoutput>
    or #'s, because you don't need them.

    Fernis Guest

  4. #3

    Default Re: Why won't this delete???

    works great! thank you
    weswhite7 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