Question: I am trying to import a file into an excel sheet that contains several xml files inside. Like the following:

Answer: 
There are a few issues here and I'm unsure if those curly quotes as I stated in comments are part of your code or not, including the "t" in `);t` <= delete that "t" if it's part of your code.

If so, `‘ ’` and `“ ”` need to be changed to `'` and `"` respectively.

However, your connection is using `$dbh`, and you're using `$con` in your query. 

```
$dbh = new PDO('mysql:host=localhost;dbname=probe', $root);
^^^^                                                ^^^^^ unknown

```

and the query:

```
$stmt = $con->prepare( $query ); // minus the "t" of course.
        ^^^^

```

* That would cause your query to fail right there.

However, `$root` is unknown and not posted.

Check for errors:

* <http://php.net/manual/en/pdo.error-handling.php>
* <http://php.net/manual/en/function.error-reporting.php>

Add [**error reporting**](http://php.net/manual/en/function.error-reporting.php) to the top of your file(s) which will help find errors.

```
<?php 
error_reporting(E_ALL);
ini_set('display_errors', 1);

// rest of your code

```

**Sidenote:** Displaying errors should only be done in staging, and never production.

Also add `$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);` right after the connection is opened.

* Either `$dbh` or `$con`, depending on which variable you are using.
This is how I do upload the picture in the database. You were absolutely right, because I used the code from this site: <http://www.phpro.org/tutorials/Storing-Images-in-MySQL-with-PHP.html>. But I did some changes in the code. 

```
     <?php
        if(!isset($_FILES['userfile']))
            {
            echo '<p>Please select a file</p>';
            }
        else
            {
            try    {
                upload();

                echo '<p>Thank you for submitting</p>';
                }
            catch(Exception $e)
                {
                echo '<h4>'.$e->getMessage().'</h4>';
                }
            }
        ?>

        <?php 

        function upload(){

        if(is_uploaded_file($_FILES['userfile']['tmp_name']) && getimagesize($_FILES['userfile']['tmp_name']) != false)
            {
            $size = getimagesize($_FILES['userfile']['tmp_name']);
            $type = $size['mime'];
            $imgfp = fopen($_FILES['userfile']['tmp_name'], 'rb');
            $size = $size[3];
            $name = $_FILES['userfile']['name'];
            $maxsize = 100000;
             if($_FILES['userfile']['size'] < $maxsize )
                {
                $dbh = new PDO("mysql:host=localhost;dbname=probe", 'root', '');
     $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      $stmt = $dbh->prepare("UPDATE users SET image='$imgfp', image_type='$type', image_size='$size', image_name='$name' ");
      $stmt->execute();
                }
            else
                {

                throw new Exception("File Size Error");
                }
            }
        else
            {

            throw new Exception("Unsupported Image Format!");
            }
        }
        ?>

```

This is how I retrieve the picture.

```
<div class="row">
            <div class="col-md-3 col-sm-3">

                <form
                    img src="../reg/source.php" method="get" ></form></div></div>

```