title: 500 Internal Server Error using php and mysql
body: <p>So my website keeps giving me a 500 Internal Server Error when I attempt to open my PHP file to write to the MySQL database</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id="body"&gt;
  &lt;form action="index.php" method="post" /&gt;
    &lt;input type="text" name="usertext" /&gt;
    &lt;input type="submit" value="Submit" /&gt;
   &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>&lt;?php
  
   define('DB_NAME', '****');
   define('DB_USER', '****');
   define('DB_PASSWORD', '****');
   define('DB_HOST', '****');
  
   $link = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD);
  
   if (!$link) {
      die('Could not connect: ' . mysqli_error());
   }
  
  $db_selected = mysqli_select_db(DB_NAME, $link);
  
  if (!$db_selected) {
      die('Cannot access' . DB_NAME . ': ' . mysqli_error());
  }
  
  $value = $_POST['****'];
  
  $sql = "INSERT INTO **** (****) VALUES ('$value')";
  
  if (!mysqli_query($sql)) {
      die('Error: ' . mysqli_error());
  }
  
  mysqli_close();
  ?&gt;
  </code></pre>
  
  <p>I'm still new to HTML and PHP, but I can't figure out what I did wrong even after hours of searching. My website keeps giving me that same error. I use goDaddy as a host if that helps at all.</p>