-
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 ?
-
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
-
FK'n_dog
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|