note 127952 added to pdo.prepare
| From: | chickenwing04 at web dot de | Date: | Tue, 22 Nov 2022 21:30:49 +0000 |
| Subject: | note 127952 added to pdo.prepare | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219907@lists.php.net to get a copy of this message | ||
<?php
namespace Fotofreunde\Model;
use PDOException;
class PhotoModel extends Database
{
public function writePhotoData($values)
{
$guid = $this->createUUID();
$pdo = $this->linkDB();
$sql = "INSERT INTO photo ('id', 'userId', 'categoryId',
title,filename, description) VALUES (:guid, :userId, :categoryId, :title, :filename,
:description)";
try {
$sth = $pdo->prepare($sql);
$sth->execute(array(":guid" => $guid,
":userId" => $values["userId"],
"categoryId" => $values["categoryId"],
"title" => $values["title"],
"filename" => $values["filename"],
"description" => $values["description"]));
} catch (\PDOException $e) {
new \Fotofreunde\Library\ErrorMsg("Verbindung konnte nicht aufgebaut werden.",
$e);
die;
}
return true;
}
}
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.161 (proxied: 92.196.251.44)
----
Manual Page -- https://php.net/manual/en/pdo.prepare.php
Edit -- https://main.php.net/note/edit/127952
Del: integrated -- https://main.php.net/note/delete/127952/integrated
Del: useless -- https://main.php.net/note/delete/127952/useless
Del: bad code -- https://main.php.net/note/delete/127952/bad+code
Del: spam -- https://main.php.net/note/delete/127952/spam
Del: non-english -- https://main.php.net/note/delete/127952/non-english
Del: in docs -- https://main.php.net/note/delete/127952/in+docs
Del: other reasons-- https://main.php.net/note/delete/127952
Reject -- https://main.php.net/note/reject/127952
Search -- https://main.php.net/manage/user-notes.php