[wp-trac] [WordPress Trac] #42352: Support use of native MySQLi prepared queries

WordPress Trac noreply at wordpress.org
Fri Oct 27 06:59:49 UTC 2017


#42352: Support use of native MySQLi prepared queries
-------------------------+------------------------------
 Reporter:  dd32         |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Database     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  early        |     Focuses:
-------------------------+------------------------------

Comment (by dd32):

 [attachment:42352.2.diff] fixes a few bugs here and there.
 Notably:
  - [attachment:42352.diff] uses `mysqli_stmt_get_result()` which is PHP
 5.3+ but also only available with `mysqlnd`
  - [attachment:42352.2.diff] uses `mysqli_fetch_fields(
 mysqli_stmt_result_metadata() )` which appears to be supported anywhere
 MySQLi is.
 The above change does require more variable binding, but is more portable
 and compatible with the core MySQLi extension. The mysqlnd function could
 be used conditionally, but that introduces more code paths and
 conditionals for testing which needlessly complicates it (unless it's
 performance is far better)

 The only thing in the patch I haven't tested is the
 `create|alter|truncate|drop` return values, although I doubt they
 could/would be used with prepared statements.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42352#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list