title: jQuery - AJAX POST Request is giving a 500 Internal Server Error
body: <p>So like this post's title says, I'm sending a POST request via jQuery's AJAX method. However, the PHP code it runs does indeed run. Everything in the PHP code works as it should. The only issue is that it's not returning a success in order to run the <code>success</code> function.</p>
  
  <p>Client-Side JS Code:</p>
  
  <pre><code>&lt;script&gt;
  
              function commandUpdate(command, action, element) {
                $.ajax({
                  type: "POST",
                  url: "update/commands.php",
                  data: {id: window.location.href.split("?id=").slice(1).join("?id="), type: "NA", command: command, action: action, value: document.getElementById(command + "Text").value},
                  success: function() {
                    document.getElementById(element).innerHTML = ""
                    location.reload()
                  }
                })
              }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Server-Side PHP Code:</p>
  
  <pre><code>&lt;?php
  
    $connection = mysqli_connect("myIP", "user", "pass", "dbName");
  
    $loginID = $_POST["id"];
    $type = $_POST["type"];
    $value -&gt; command = str_replace("\"", "\\\"", $_POST["command"]);
    $value -&gt; action = str_replace("\"", "\\\"", $_POST["action"]);
    $value -&gt; value = str_replace("\"", "\\\"", $_POST["value"]);
    $value = json_encode($value);
  
    mysqli_query($connection, "INSERT IGNORE INTO requests (loginID, category, type, value) VALUES ('$loginID', 'commands', '$type', '$value')");
  
    mysqli_close($connection);
  
   ?&gt;
  </code></pre>
  
  <p>All of it works, except for the fact that the console has the <code>500 Internal Server Error</code> and the <code>success: function() {//code}</code> part isn't being executed. Is there something that I'm missing here?</p>