Cant send images to Mysql Server
<p>I am having trouble with my code. I am trying to make a upload function to send ads to a database. It simple contains an image. Here is my PHP file </p>

<pre><code>&lt;?php
    $servername = ""; //Taken out for stack overflow question
    $username = ""; //Taken out for stack overflow question
    $password = ""; //Taken out for stack overflow question  
    $dbname = ""; //Taken out for stack overflow question

    $conn = mysqli_connect($servername, $username, $password, $dbname);

    if (!$conn)
    {
        echo 'Could not connect';
    }
    else 
    {
        $cf = $_POST['cf']; //Image file 
        $category = $_POST['category']; //Category
        mysqli_query($conn, "INSERT INTO".$category."VALUES(".$cf.")"); //Query
    }

    mysqli_close($conn);
?&gt;
</code></pre>

<p>If it is syntax, keep in mind, I have no way to debug it. My server on my computer (xampp) no longer works, so I am just uploading it to my online web server and playing it by sight. It shows no errors or debug info. </p>

<p>Here is my "form" it is made by ajax so form tags are removed. </p>

<pre><code>            &lt;div class="modal fade chromeModal"&gt;
                &lt;div class="modal-dialog"&gt;
                    &lt;div class="modal-content"&gt;
                        &lt;div class="modal-header"&gt;
                            &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                            &lt;h2&gt;Chrome form&lt;/h2&gt;
                        &lt;/div&gt;
                        &lt;div class="modal-body"&gt;
                            &lt;div class="imgPreview"&gt;

                            &lt;/div&gt;
                        &lt;/div&gt;
                        &lt;div class="modal-footer"&gt;
                            &lt;div role="form" class="form-inline alignButtons"&gt;
                                &lt;div class="form-group"&gt;
                                    &lt;label for="category"&gt;&lt;/label&gt;
                                    &lt;select class="form-control" id="category"&gt;
                                        &lt;option id="cat1"&gt;Food&lt;/option&gt;
                                        &lt;option id="cat2"&gt;Software&lt;/option&gt;
                                        &lt;option id="cat3"&gt;Hardware&lt;/option&gt;
                                        &lt;option id="cat4"&gt;Home&lt;/option&gt;
                                        &lt;option id="cat5"&gt;Outdoor&lt;/option&gt;
                                        &lt;option id="cat6"&gt;Indoor activities&lt;/option&gt;
                                        &lt;option id="cat7"&gt;Services&lt;/option&gt;
                                        &lt;option id="cat8"&gt;Other&lt;/option&gt;
                                    &lt;/select&gt;
                                &lt;/div&gt;
                                &lt;div class="form-group"&gt;
                                    &lt;label class="btn btn-primary btn-file"&gt;
                                        Upload &lt;input type="file" class="btn btn-primary" id="upload" name="cf" style="display:none;"&gt;
                                    &lt;/label&gt;
                                &lt;/div&gt;
                                &lt;div class="form-group"&gt;
                                    &lt;button type="button" class="btn-default" id="submit"&gt;Submit&lt;/button&gt;
                                &lt;/div&gt;
                            &lt;/div&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
</code></pre>

<p>And lastly the event listeners </p>

<pre><code>chromeOnly.addEventListener("click", function() {
    Notification.requestPermission(function(request) {
        console.log(request);
    });
    $(".chromeModal").modal('show');
    var chromeOnlyData = $('#upload').val();
    $.ajax({
        url: 'http://4lifeidiomas.com/smartlead/app/php/sendChrome.php',
        type: 'POST',
        data: chromeOnlyData,
        success: function(data)
        {
            var chromeSent = new Notification('Smart Lead Advertisment', {
                icon: 'http://4lifeidiomas.com/smartlead/app/logo.png',
                body: 'Successfully sent to Google Chrome extension!'
            });
        },
        error: function()
        {
            var chromeSentError = new Notification('Smart Lead Advertisment', {
                icon: 'http://4lifeidiomas.com/smartlead/app/logo.png',
                body: 'Error trying to send data to Google Chrome'
            });
        }
    });
}, false);
</code></pre>

<p>But I cannot get it to work. What am I doing wrong? What can I do to fix it?</p>