A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Deleting records from Database

  1. #1
    Senior Member
    Join Date
    Oct 2000
    Location
    Belgium, Hasselt
    Posts
    346

    Deleting records from Database

    Hello,

    i have some buttons that, when pressed have to delete records from my Db.

    now my AS is:

    code:

    var recordToDelete:Number = 0;

    knop1_mc.onRelease = function():Void {
    recordToDelete = 1;
    getURL("delete.php?id=" + recordToDelete, "_blank");
    }




    and my php is:

    PHP Code:
    <?php
    if (isset($_GET['id']) && !empty($_GET['id'])){
       
    $conn mysql_connect("localhost""root""pass");
       
    $acdb mysql_select_db("database");
       
    $sql "DELETE FROM tabelnaam WHERE id = " mysql_escape_string($_GET['id']);
       
    $qry mysql_query($sql);
    }
    ?>
    but this doesn't work. Any better ways ?

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Seoul, South Korea
    Posts
    1,310
    Hi there,
    Not the best solution
    If you don't want to go down the remoting path you should take a look at sendAndLoad.
    This will allow you send a varaible to your php script and upon deletion send back a flag to inform thew user that the item had indeed being deleted.
    The way you outlined would not be able to achieve this.

    HTH
    !.....................................COMING SOON

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    where the files i sent to you in message_datagrid01.zip of no use ?
    you never responded to say if they were or not

    they included a sendAndLoad method of deleting a file from the database,
    suggest (in agreement with micmac) you use this method

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center