$conn = new PDO("mysql:host=".self::ServerName.";dbname=".self::DBName, self::UserName, self::Password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("INSERT INTO ".self::tableName." (id, userId, userName, productId, description, dataTime) VALUES (null, 1 , 'Admin', 1 , :description, :productId)");
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$stmt->bindParam(':email', $email);
$stmt->bindParam(':productId', $productId);
$stmt->bindParam(':description', $description);
$stmt->execute();
хз, попробуй bindValue
Обсуждают сегодня