Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Request #9332 Customize prepared statement name
Submitted: 2006-11-14 17:16 UTC
From: kailoran at gmail dot com Assigned:
Status: Open Package: MDB2 (version 2.3.0)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kailoran at gmail dot com
New email:
PHP Version: Package Version: OS:

 

 [2006-11-14 17:16 UTC] kailoran at gmail dot com (Kailoran)
Description: ------------ It would be useful if prepare() took another argument that would be used to name the prepared statement instead of using $this->options['statement_format']. This would allow easy naming of individual statements without having to change the option every time and restoring it back afterwards. Test script: --------------- // One way of doing it: /* in MDB2.php, change default options['statement_format'] to have a placeholder for a string, eg. */ 'statement_format' => 'MDB2_STATEMENT%3$s_%1$s_%2$s' /* change the definition of prepare() */ function &prepare($query, $types = null, $result_types = null, $lobs = array(), $statement_name = '') /* in the prepare() functions, use the new parameter */ ... $statement_name = sprintf($this->options['statement_format'], $statement_name, $this->phptype, md5(time() + rand()), $statement_name);

Comments