If you don't have anything nice to say, don't say anything at all. (And certainly don't return the results of a previous query to an empty query.)
git-svn-id: http://svn.automattic.com/wordpress/trunk@5858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b64ce2d0f0
commit
0311e61389
|
@ -260,6 +260,8 @@ class wpdb {
|
||||||
$this->func_call = "\$db->get_var(\"$query\",$x,$y)";
|
$this->func_call = "\$db->get_var(\"$query\",$x,$y)";
|
||||||
if ( $query )
|
if ( $query )
|
||||||
$this->query($query);
|
$this->query($query);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
|
||||||
// Extract var out of cached results based x,y vals
|
// Extract var out of cached results based x,y vals
|
||||||
if ( $this->last_result[$y] ) {
|
if ( $this->last_result[$y] ) {
|
||||||
|
@ -281,6 +283,8 @@ class wpdb {
|
||||||
$this->func_call = "\$db->get_row(\"$query\",$output,$y)";
|
$this->func_call = "\$db->get_row(\"$query\",$output,$y)";
|
||||||
if ( $query )
|
if ( $query )
|
||||||
$this->query($query);
|
$this->query($query);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
|
||||||
if ( !isset($this->last_result[$y]) )
|
if ( !isset($this->last_result[$y]) )
|
||||||
return null;
|
return null;
|
||||||
|
@ -305,6 +309,8 @@ class wpdb {
|
||||||
function get_col($query = null , $x = 0) {
|
function get_col($query = null , $x = 0) {
|
||||||
if ( $query )
|
if ( $query )
|
||||||
$this->query($query);
|
$this->query($query);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
|
||||||
// Extract the column values
|
// Extract the column values
|
||||||
for ( $i=0; $i < count($this->last_result); $i++ ) {
|
for ( $i=0; $i < count($this->last_result); $i++ ) {
|
||||||
|
@ -324,6 +330,8 @@ class wpdb {
|
||||||
|
|
||||||
if ( $query )
|
if ( $query )
|
||||||
$this->query($query);
|
$this->query($query);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
|
||||||
// Send back array of objects. Each row is an object
|
// Send back array of objects. Each row is an object
|
||||||
if ( $output == OBJECT ) {
|
if ( $output == OBJECT ) {
|
||||||
|
|
Loading…
Reference in New Issue