title: How to save value on a drop down to mysql
body: <p>Im just new in programming and im creating  a simple drop down using html where you can choose  what pet you are looking for/ Options are DOG, CAT, FISH and Others. if you choose others a text box will show so you can fill it up if the pet you looking for is not in the list.
  My problem is that if i choose the an option on the drop down it doesn't save on the database but it shows blank and if i choose others and fill out the text box it will  be saved on the database</p>
  
  <p>codes that i did is here .. hope you can help</p>
  
  <pre><code> &lt;select name="lookingfor" onchange='CheckInfo(this.value);' &gt; 
  &lt;option&gt;What your looking for?&lt;/option&gt;  
  &lt;option value="DOG"&gt;DOG&lt;/option&gt;
  &lt;option value="CAT"&gt;CAT&lt;/option&gt;
  &lt;option value="FISH"&gt;FISH&lt;/option&gt;
  &lt;option value="others"&gt;Others&lt;/option&gt;
  </code></pre>
  
  <p><br /></p>
  
  <pre><code>   &lt;input type="text" name="lookingfor" id="lookingfor" style='display:none;' placeholder="What kind of pet ?" class="lookingfor"/&gt; 
  </code></pre>
  
  <p>for PHP to save to the database is here..</p>
  
  <pre><code>    &lt;?php
  $con=mysqli_connect("****","****","c****","****");
  
  // Check connection
  if (mysqli_connect_errno($con))
    {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
  
     mysqli_query($con,"INSERT INTO injectinfo (lookingfor)
     VALUES ('$_POST[lookingfor]')");
  
     mysqli_close($con);
  </code></pre>
  
  <p>?></p>