title: Inserting a PHP enum into a SQL database through a prepared statement
body: <p>I've currently got a prepared statement that puts the data from an HTML form through a Prepared Statement (PHP) into a SQL database.</p>
  <p>The problem here; one field remains empty after putting it into the DB. The 'gender' field, which is an ENUM(M,F,O). The rest gets filled up with the right data.</p>
  <p>Is there any way for me to get the gender into the table along with the other data?</p>
  <p><em>The relevant HTML:</em></p>
  <pre><code>    &lt;input type=&quot;radio&quot; id=&quot;man&quot; name=&quot;gender&quot; value=&quot;man&quot;&gt;
      &lt;label for=&quot;man&quot;&gt;Man&lt;/label&gt;
  
      &lt;input type=&quot;radio&quot; id=&quot;woman&quot; name=&quot;gender&quot; value=&quot;woman&quot;&gt;
      &lt;label for=&quot;woman&quot;&gt;Woman&lt;/label&gt;
  
      &lt;input type=&quot;radio&quot; id=&quot;other&quot; name=&quot;gender&quot; value=&quot;other&quot;&gt;
      &lt;label for=&quot;other&quot;&gt;Other&lt;/label&gt;
  </code></pre>
  <p><em>The PHP:</em></p>
  <pre><code>$firstname= htmlentities($_POST['firstname'], ENT_QUOTES);
  $lastname= htmlentities($_POST['lastname'], ENT_QUOTES);
  $gender=  htmlentities($_POST['gender'], ENT_QUOTES);
  $birthdate= preg_replace(&quot;([^0-9-])&quot;, &quot;&quot;, $_POST['birthday'], ENT_QUOTES);
  $email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
  $portfolio = filter_var($_POST['portfolio'], FILTER_SANITIZE_URL);
  
  $query = &quot;INSERT INTO `table` (`firstname`, `lastname`, `gender`, `birthdate`, `email`, `portfolio`)
  VALUES (?, ?, ?, ?, ?, ?)&quot;;
  
  mysqli_stmt_bind_param($stmt, &quot;ssssss&quot;, $firstname, $lastname, $gender, $birthdate, $email, $portfolio);
  
  mysqli_stmt_execute($stmt);
  $prepstmt = mysqli_stmt_get_result($stmt);
  </code></pre>