php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #48073 PDO bindParam
Submitted: 2009-04-25 00:46 UTC Modified: 2009-04-27 08:41 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: admin at wdfa dot co dot uk Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.9 OS: na
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: admin at wdfa dot co dot uk
New email:
PHP Version: OS:

 

 [2009-04-25 00:46 UTC] admin at wdfa dot co dot uk
Description:
------------
Hi,

Would it be possible to allow pdo->bindParam / pdo->bindValue to bind to column names.

i.e. 

<?php
$sql="UPDATE `table` SET :name='test'";
$stm=$db->prepare($sql);
$stm->bindParam(":name","column",PDO::PARAM_STR);
$stm->execute();
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-27 08:41 UTC] johannes@php.net
This is not possible with prepared statements, as the database server won't be able to create the query plan without knowing the field names.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Dec 30 10:00:01 2025 UTC