It looks fine - have you printed any errors?
Notice in the one query you're putting $medid in quotes, in the other not.
Also it's a good idea, especially for expansion to use textbox arrays like this:
<input name="pictbox[]" value="$x">
Then in your program you can just go through the array as
foreach ($_POST['pictbox'] as $index)
{
$q = "DELETE FROM something WHERE id = $index";
}
You'll have to check if pictbox is set in post first in case none have been set.