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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 16:01:31 2024 UTC