title: How to get the path of a selected file in input type="file" using php?
body: <p>I want to get the path of a selected file and store it in the database for future use.
  I have the following code but it does not work.</p>
  
  <pre><code>$path = $_FILES['txtImage']['tmp_name'];
  $sql = "INSERT INTO tblquestions (q_category, q_question, q_image, q_correct, q_answer2, q_answer3, q_answer4) VALUES ('$_POST[txtCategory]','$_POST[txtQuestion]','$path','$_POST[txtCorrect]','$_POST[txtChoice2]','$_POST[txtChoice3]','$_POST[txtChoice4]')";
  </code></pre>
  
  <p>txtImage is the name of my input type="file" and $path is the code i am using but it does not work. IT just returns blank.</p>
  
  <p>Anyone who can help me or lead me to a different, hopefully easier method? Thank you in advance. :)</p>