title: i want to send an attachment in a form sql and php ..?
body: <p>i want to send an attachment in a form so i used this code .. ! </p>
  
  <pre><code>   &lt;form id="form1"  name="form1" autocomplete="off" enctype="multipart/form-data"
      method="post" novalidate action="triprequestexcuton.php"&gt;
       &lt;input type="file" name="form_data" size="40"&gt; 
        &lt;p&gt;&lt;input type="submit" name="submit" value="submit"&gt; 
  </code></pre>
  
  <p>then in triprequestexcuton.php </p>
  
  <pre><code> $form_data=$_POST['form_data'];
   $attachment = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
   $qry="insert into triprequest values('','". $attachment."');"; 
   $resultop=mysql_query($qry);
  </code></pre>
  
  <p>but one i check the database i find the fileld like this [BLOB - 0B] ! 
  my problem with 0B ! 
  so how can i fix it ? </p>