title: Mysql fetch data selection from html checkbox
body: <p>I want to get multiple return value for checkbox. But problem is with following code check box only can echo a single value. Even I select multiple checkbox I am getting only single value form it. How to solve it</p>
  
  <pre><code>$q2 = mysqli_query($conn,"SELECT product_img_url FROM temp_img");
  
  while ($row = mysqli_fetch_array($q2)) {
      $product_img_url = $row['product_img_url'];
      $target_dir = "../assets/img/temp_img/";
      $img_link = $target_dir.$product_img_url;
  
      echo '&lt;br&gt;Add it&lt;br&gt;&lt;input type="checkbox" name="pic_tobe_add" value="'.$img_link.'"&gt;&lt;br&gt;&lt;img src="'.$img_link.'" class="img-rounded" alt="Uploaded image" width="152" height="118"&gt;&lt;br&gt;&lt;br&gt;';
  }
  if(isset($_POST['submit_p'])) {
     if (empty($_POST['pic_tobe_add'])) {
        echo "Error: select a pic";
    }else{echo $pic_tobe_add = $_POST['pic_tobe_add'];}
  }
  echo '&lt;br&gt;&lt;input type="submit" name="submit_p" value="Add this product"&gt;&lt;form&gt;';
  </code></pre>