title: Insert multiple checkbox value with textbox value in database
body: <pre><code>   &lt;b&gt;
     &lt;li&gt;
      &lt;img height="150" width="200"src="&lt;?php echo $images_dir."/tb_".$row[2]; ?&gt;"/&gt;
       &lt;input type='checkbox' name='chk1[]' value ='&lt;?php echo basename($images_dir."/".$row[2]);?&gt;'/&gt;&lt;input type='text' name='textbox[]'id='textbox'/&gt;    &lt;/br&gt;
  </code></pre>
  
  <p>This code shows some images with checkbox and textbox. I want to select one or more  image and give them text value and store in database. Here is the code is for inserting</p>
  
  <pre><code>  $checkbox1=$_POST['chk1'];
  
     $txt=$_POST['textbox'];
  
     if($_POST["submit"]=="submit") {
     for($i=0;$i&lt;sizeof($checkbox1);$i++) {
     if(!empty($txt)) {
    echo""
    $query="INSERT INTO message(item,quantity)       VALUES('".$checkbox1[$i]."','".$txt[$i]."')";
      mysql_query($query) or die(mysql_error());
    }
    }
   echo "message is send";
   }
   ?&gt;
  </code></pre>
  
  <p>When i run this code then it inserts only checkbox value but textbox value is not   inserted in database</p>