lundi 4 juillet 2016

Insert at specific 'ID' into my table.


I need to write a PHP script using a database for school. Since my MySQL skills are currently dying, I would like to ask following question: Following problem: I need to insert 'upload' at a specific 'ID' into my table. It should make something like this: insert into PHP_Project() where ID = ;

$pdo = new PDO($this->dsn, $this->username, $this->password, $this->pdoAttributes);
$statement = $pdo->prepare('insert into PHP_Project(upload) where ID = ? values (?,?)');

            $statement->bindParam(1, $filename);
            $statement->bindParam(2, $projectID);

            $statement->execute();

I hope somebody can help me. Thanks in advance!!


Aucun commentaire:

Enregistrer un commentaire