This is my upload.php :

```
    public function add()
    {
        $file = $_FILES["image"];
        if (!(isset($file))) {
            $error = "Fichier manquant";
        } else if ($file["size"] == 0) {
            $error = "Fichier vide ou trop grand (max 3MB)";
        } else if ($file["error"] != 0) {
            $error = "Problème lors de l'envoi du fichier";
        } else {
            // chaque utilisateur possède son propre répertoire d’upload
            $uploadfile = $GLOBALS["upload"] . "/" . $_SESSION["login"];
            /*echo $uploadfile . "<br>";*/
            if (!file_exists($uploadfile)) {
                mkdir($uploadfile, 0777, true);
            }
            $filename = "/" . $file["name"];
            $uploadfile = $uploadfile . $filename;
            /*echo $uploadfile  . "<br>";
            echo $file['tmp_name']  . "<br>";*/
            print_r($_FILES);
            print_r($_REQUEST);
            move_uploaded_file($file['tmp_name'], $uploadfile);
            $this->model->addpic(array("path" => $GLOBALS["uploadURL"] . "/" . $_SESSION["login"] . $filename));
        }

```

And my function to add the files path in my db :

```
    public function addpic($user) {
        $this->open();
        $stmt = $this->pdo->prepare("INSERT INTO pictures (path) VALUES (:path)");
        return $stmt->execute(array(":title"=>$user["title"],":description"=>$user["description"]));
    }

```

My PHP debug says that there is an error in the last line of my addpic function :

```
return $stmt->execute(array(":title"=>$user["title"],":description"=>$user["description"]));

```

But I don't understand what is the error because each field exist in my db ?

Do you have any idea why I have this error ?

```
Exception: PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in /Applications/MAMP/htdocs/legogram/app/model/model.php:86
Stack trace:
#0 /Applications/MAMP/htdocs/legogram/app/model/model.php(86): PDOStatement->execute(Array)
#1 /Applications/MAMP/htdocs/legogram/app/controller/addphoto.php(48): Model->addpic(Array)
#2 /Applications/MAMP/htdocs/legogram/public/index.php(67): Addphoto->add()
#3 {main}

```

Thank you for your help