thanks guys for the aid.

in the end, i went with creating a check box that looks like this:

<input type="checkbox" name="del[]" value="<?php print($row[id]); ?>">

and the dirty work of deleting it looks like this::

foreach($_POST["del"] as $val) {

 $sql = "DELETE FROM $tablename WHERE id = $val";

...connect to database.. run $sql.. close db.. yadda yadda..


i can do this on the same page... it's short and pretty easy to follow. ...
oh .. and it works :)


> One way you could do this.  Is have the form point to itself i.e.
> then set a variable in the form if it is set when the page loads the run
> form processing script.  As for the delete function one way to do it would
> be since you are holding the checkboxes in an array.  Do a while or a for
> loop doing the delete statement for each id.  Like the following code.
> for($i = 0; $i < count(chkBoxArray); $i++){
>       $sql = "DELETE FROM tblName WHERE tblID =  '$row[$i]'";
>       if(!sql_query($sql)){
>             echo "ERROR: ".mysql_query();
>        }
> }
> Or something of that sort.  Hope it helps.
>     -Mike

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to