use array_key_exists instead of isset so that we can return nulls
This commit is contained in:
parent
d31207dd53
commit
75248e7465
|
@ -164,16 +164,16 @@ function dbFetchOne( $sql, $col=false, $params=NULL ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $result && $dbRow = $result->fetch( PDO::FETCH_ASSOC ) ) {
|
if ( $result && $dbRow = $result->fetch(PDO::FETCH_ASSOC) ) {
|
||||||
if ( $col ) {
|
if ( $col ) {
|
||||||
if ( ! isset( $dbRow[$col] ) ) {
|
if ( ! array_key_exists($col, $dbRow[$col]) ) {
|
||||||
Warning( "$col does not exist in the returned row " . print_r($dbRow, true) );
|
Warning("$col does not exist in the returned row " . print_r($dbRow, true));
|
||||||
}
|
}
|
||||||
return $dbRow[$col];
|
return $dbRow[$col];
|
||||||
}
|
}
|
||||||
return $dbRow;
|
return $dbRow;
|
||||||
}
|
}
|
||||||
return( false );
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbFetchAll( $sql, $col=false, $params=NULL ) {
|
function dbFetchAll( $sql, $col=false, $params=NULL ) {
|
||||||
|
|
Loading…
Reference in New Issue