Topic awaiting preservation: Deleting selected |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: 1393 |
posted 01-22-2006 20:43
Ok, I've been working on having this control room of mine be able to delete all entrys that are selected (via checkbox). I've finaly got something that works but I'm not 100% sure why it works, and if there is anything wrong with it. code: <input type="checkbox" name="deleted_items[]" "value="' . $id . '" />
code: if ($_POST["deleted_items"]) { $deleted_items = join(', ', $_POST["deleted_items"]); $query = "DELETE FROM newsTable WHERE id IN ($deleted_items)"; $result = mysql_query($query); }
|
Lunatic (VI) Inmate From: under the bed |
posted 01-22-2006 21:55
Your HTML doesn't know. |
Paranoid (IV) Inmate From: 1393 |
posted 01-24-2006 04:57
Ah, so how come in code: $_POST["deleted_items"] the brackets are not used? |
Lunatic (VI) Inmate From: under the bed |
posted 01-24-2006 05:25
quote:
|
Paranoid (IV) Inmate From: 1393 |
posted 01-24-2006 19:55
Oh man... I guess I need to read up on $_POST[] and arrays. I really haven't done anything that uses arrays so they confuse me just a bit. Thanks for all your help DL... you've been awesome. |