Deleting Data with ColdFusion - macromedia COLDFUSION MX 7 Web Application Construction Kit [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

macromedia COLDFUSION MX 7 Web Application Construction Kit [Electronic resources] - نسخه متنی

Ben Forta, Raymond Camden, Leon Chalnick, Angela Buraglia

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید











  • Deleting Data with ColdFusion


    ColdFusion is very efficient at adding and updating data, but not at deleting it. DELETE is always a dangerous operation, and the ColdFusion developers didn't want to make it too easy to delete data by mistake.

    To delete data in a ColdFusion template, you must use the SQL DELETE statement, as shown in Chapter 6 for an explanation of the DELETE statement.

    Listing 14.12. delete1.cfmDeleting Table Data with SQL DELETE


    <!---
    Name: delete1.cfm
    Author: Ben Forta (ben@forta.com)
    Description: Table row delete demo
    Created: 12/21/04
    --->
    <!--- Check that FilmID was provided --->
    <cfif NOT IsDefined("FilmID")>
    <h2>You did not specify the FilmID</h2>
    <cfabort>
    </cfif>
    <!--- Delete a movie --->
    <cfquery datasource="ows">
    DELETE FROM Films
    WHERE FilmID=#FilmID#
    </cfquery>
    <!--- Page header --->
    <cfinclude template="header.cfm">
    <!--- Feedback --->
    <h2>Movie deleted</h2>
    <!--- Page footer --->
    <cfinclude template="footer.cfm">

    No <cfdelete> tag exists in ColdFusion. The only way to delete rows is to use a SQL DELETE.


  • / 281