title: How do I get the ID of selected datalist
body: <p>I have just figured out how to populate a datalist element from mysql. I need to get the associated ID that corresponds to the selected value to submit to another page.  I can submit the value, but I need the ID.  I hope it is a simple syntax error, but I can't figure it out.
  Thanks in advnace.</p>
  
  <pre><code>&lt;?php
  
  require 'connect_mysqli.php';
  
  $sql = "SELECT street FROM streets";
  $result = mysqli_query($con, $sql) or die ("Error " . mysqli_error($con));
  ?&gt;
  &lt;form action="new.php" name="test" method = "post"&gt;
  &lt;datalist id="street" name="streets"&gt;
      &lt;?php while($row = mysqli_fetch_array($result)) { ?&gt;
          &lt;option value="&lt;?php echo $row['street']; ?&gt;"&gt;&lt;?php echo $row['street_id']; ?&gt;&lt;/option&gt;
      &lt;?php 
      } 
  ?&gt;
  
  &lt;/datalist&gt;
  &lt;input type="text" name="street" id="test" autocomplete="off" list="street"&gt;
  &lt;input type="submit" value="Submit"&gt;
  &lt;?php 
  mysqli_close($con); 
  ?&gt;
  </code></pre>