Allereerst moet u deze HTML wijzigen zodat het selectievakje een array is
$query = "select * from pharmacy";
$result = mysql_query($query);
$num = mysql_num_rows($result);
$num1 = mysql_num_fields($result);
if($num>0)
{
echo "<table border=2>";
for($i=0;$i<$num;$i++)
{
$row=mysql_fetch_row($result);
echo "<tr>";
echo"<td><input type='Checkbox' name='pi[$i]' /></td>";
echo"<td>$row[0]</td>";
echo"</tr>";
}
dan op de actiepagina
foreach($_POST['pi'] as $key=>$value)
{
if($value=="on")
{
//DO THE INSERT CODE HERE
// the $key is the $i counter in the HTML
// the $value is whether the user selected it no in this case its just on/off
}
}