[Bb-trac] [bbPress] #728: Strange uses of get_col() are hard to
understand and only sometimes more efficient
bbPress
bb-trac at lists.bbpress.org
Fri Aug 10 22:49:00 GMT 2007
#728: Strange uses of get_col() are hard to understand and only sometimes more
efficient
----------------------------+-----------------------------------------------
Reporter: mdawaffe | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 0.8.3 & XML-RPC
Component: Administration | Version: 1.0-alpha (trunk)
Severity: normal | Keywords:
----------------------------+-----------------------------------------------
bbPress has a lot of
{{{
$foo_col = $bbdb->get_col( "SELECT foo, bar FROM table" );
$bar_col = $bbdb->get_col( '', 1 );
}}}
This isn't all that clear. Opaque enough, actually, that WordPress has
gotten rid of the feature entirely in their DB class. Since bbPress and
WordPress share the same DB class, we need to get rid of all
{{{$bbdb->get_col( '', x )}}} instances.
We can usually just use {{{$bbdb->get_results()}}} with insignificant
impact. Where get_col really is more efficient, we can use get_results
and pass the returned value through a helper function to split the row-
centric data into column-centric data.
--
Ticket URL: <http://trac.bbpress.org/ticket/728>
bbPress <http://bbpress.org/>
Innovative forum development
More information about the Bb-trac
mailing list