Skip to content

Commit

Permalink
Remove unnecessary code in db_result()
Browse files Browse the repository at this point in the history
Since we now use ADODB_FETCH_ASSOC fetch mode, it is no longer necessary
to check the recordset for numerically indexed columns.
  • Loading branch information
dregad committed Nov 29, 2015
1 parent d72b362 commit f74b3fd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions core/database_api.php
Expand Up @@ -565,13 +565,10 @@ function db_result( $p_result, $p_index1 = 0, $p_index2 = 0 ) {
$p_result->Move( $p_index1 );
$t_result = $p_result->GetArray();

if( isset( $t_result[0][$p_index2] ) ) {
return $t_result[0][$p_index2];
}

# The numeric index doesn't exist. FETCH_MODE_ASSOC may have been used.
# Get 2nd dimension and make it numerically indexed
# Make the array numerically indexed. This is required to retrieve the
# column ($p_index2), since we use ADODB_FETCH_ASSOC fetch mode.
$t_result = array_values( $t_result[0] );

return $t_result[$p_index2];
}

Expand Down

0 comments on commit f74b3fd

Please sign in to comment.