jQuery AJAX: Returns request.fail upon success
<p>Have the following jQuery AJAX call. It functions correctly and pulls off the PHP/MySQL operations, but returns the <code>request.fail</code> function instead of the normal done/success. Works fine if you comment/remove the MySQL query.</p>

<p>Did a lot of searching and believe it is something to do with the <code>dataType</code>, which I've tried as <code>text</code>, <code>html</code>, and <code>""</code> according to other posts. Tried using <code>html</code> as the <code>dataType</code> and just changing the <code>echo "Success.";</code> for standard HTML/text output after the PHP code, but no luck. Any help would be appreciated.</p>

<p><strong>This code is a small portion of a much larger project that has been isolated  for the sake of the question. The $variable is just an example and is within scope (and not causing an issue).</strong></p>

<p><strong>Calling File:</strong></p>

<pre><code>&lt;script type="text/javascript"&gt;
        function ajaxCall() {
            var request = $.ajax({
                url: '&lt;?php echo "ajax.php?variable=$value"; ?&gt;',
                type: "GET",            
                dataType: "html"
            });

            request.done(function(msg) {
                alert(msg);

            });

            request.fail(function(jqXHR, textStatus) {
                alert( "Request failed: " + textStatus );
            });
        }
&lt;/script&gt;
</code></pre>

<p><strong>AJAX File:</strong></p>

<pre><code>&lt;?php
    $variable = $_GET['variable'];
    $sign = mysqli_query(mysqli_connect('localhost', 'user', 'password', 'database'), "INSERT INTO `Table` (`Column`) VALUES ('$variable')");
    echo "Success.";
?&gt;
</code></pre>