[wp-trac] [WordPress Trac] #11622: Implement wpdb::prepare2() which will use PDO-like syntax

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 25 17:51:17 UTC 2009


#11622: Implement wpdb::prepare2() which will use PDO-like syntax
-------------------------+--------------------------------------------------
 Reporter:  sirzooro     |       Owner:  ryan                    
     Type:  enhancement  |      Status:  new                     
 Priority:  normal       |   Milestone:  3.0                     
Component:  Database     |     Version:  2.9                     
 Severity:  normal       |    Keywords:  needs-patch dev-feedback
-------------------------+--------------------------------------------------
 This discussion started in #11608:

 '''(me)''': Replying to Denis-de-Bernardy:
 > In retrospect we should have used the syntax that is accepted by PDO for
 this stuff, i.e. either of: {{{ "SELECT * FROM foo WHERE bar = ?" # ? gets
 replaced by first variable "SELECT * FROM foo WHERE bar = :bar" # :bar
 gets replaced by variable named bar }}}

 We can consider adding new function prepare2() which will use PDO-like
 syntax, and mark prepare() as deprecated. This will require a lot of work
 (quick search showed 43 files), but we will avoid such problems in the
 future. This can be done under another ticket.

 '''miqrogroove''':
 >If you're going to re-invent the wheel, query parsing seems like a bad
 approach in general, and that particular syntax improvement offers very
 marginal benefit above the needed documentation.

 '''hakre''':
 > I think it's a good approach to shift away from the broken design.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11622>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list