[wp-trac] [WordPress Trac] #27765: Add ARRAY_K return type to wpdb::get_results()

WordPress Trac noreply at wordpress.org
Thu Jun 12 13:26:33 UTC 2014


#27765: Add ARRAY_K return type to wpdb::get_results()
-------------------------+------------------
 Reporter:  jdgrimes     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.0
Component:  Database     |     Version:  3.8
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------

Comment (by jdgrimes):

 Replying to [comment:1 pento]:
 > Can you give an example of a use case for this? Particularly, one that
 isn't covered by `OBJECT_K` or `ARRAY_A`?

 Well, anytime you have built the code around arrays, and then realize it
 would have been much better if you could have had them indexed by the
 first column. Admittedly, it in most (perhaps all?) cases it is possible
 to do it with `OBJECT_K`, but you may already be expecting arrays
 throughout your code. Basically, it's for convenience, like the other
 formats.

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


More information about the wp-trac mailing list