Thanks Gregory, I apologize for asking to much, I have tried this code but it is deleting everything

<?php
   
    require 'database.php';
             
    if($_POST['delete']) // from button name="delete"
    {
        $checkbox = $_POST['checkbox']; //from name="checkbox[]"
        $countCheck = count($_POST['checkbox']);
       
        for($i=0;$i<$countCheck;$i++)
        {
            $del_id  = $checkbox[$i];
           
            $sql = "update products set product_price = '7.6' where id = $del_id";
            $result = $mysqli->query($sql) or die(mysqli_error($mysqli));
           
        }
            if($result)
        {   
                header('Location: index.php');
            }
            else
            {
                echo "Error: ".mysql_error();
            }
    }
?>



Thanks alot

On Tue, Aug 31, 2010 at 5:15 PM, Gregory Okoth <gregory.okoth@gmail.com> wrote:
With whatever code, the safest way is to store each value of the table data displayed, (say by Primary key) with a corresponding check box index value, so that whatever check box index is selected, it will point to the exact/same primary key of a datarow, which you will then send to the DB via code for deletion.

Hope it helps!


On Tue, Aug 31, 2010 at 4:30 PM, Calvin Omari <calvinebarongo@gmail.com> wrote:
I will much appreceate

On Tue, Aug 31, 2010 at 4:27 PM, Benjamin <anangwe@gmail.com> wrote:
can i send you a function using select boxes

_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke



--
Our greatest fear is not that we are inadequate,
but that we are powerful beyond measure.
It is our light, not our darkness, that frightens us.

Calvin Omari Systems Developer/Designer
http://www.facebook.com/barongo

_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke


_______________________________________________
Skunkworks mailing list
Skunkworks@lists.my.co.ke
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------
Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1fbjAwOUE&hl=en
------------
Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke



--
Our greatest fear is not that we are inadequate,
but that we are powerful beyond measure.
It is our light, not our darkness, that frightens us.

Calvin Omari Systems Developer/Designer
http://www.facebook.com/barongo