Heres my code, i can't see a problem and it doesn't return any errors. A form with checkboxes names 1,2,3 and so on and a list with option such as delete,read,unread and so on again.
The script is ment to loop 10 times and update rows in a database or delete them if the user selected delete. Nothing get changed in my db.
include 'includes/connection.php'; // setup mysql db connection
if (isset($_GET[submit])){
$action = $_GET[mark];
$count = 1;
$max = 10;
while ($count <= $max) {
if ($_GET[$count] === "on"){
if ($action === "delete"){
$read_query = mysql_query("DELETE FROM messages WHERE mid = '$_GET[$count]'")
or die(mysql_error());;
} else {
$read_query = mysql_query("UPDATE messages SET status = '$action' WHERE mid = '$_GET[$count]'")
or die(mysql_error());;
}
}
$count++;
}
}