Added unit tests for correlated subqueries - select, from, where.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8556 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-06-30 15:36:03 +00:00
parent 5d1eb1c21e
commit 1353ade0c2
41 changed files with 661 additions and 256 deletions

View file

@ -199,7 +199,7 @@
/**
* @brief Fetch results
**/
function _fetch($result) {
function _fetch($result, $arrayIndexEndValue = NULL) {
if(!$this->isConnected() || $this->isError() || !$result) return;
$c = sqlsrv_num_fields($result);
@ -212,10 +212,14 @@
for($i=0;$i<$c;$i++){
$row->{$m[$i]['Name']} = sqlsrv_get_field( $result, $i, SQLSRV_PHPTYPE_STRING( 'utf-8' ));
}
$output[] = $row;
if($arrayIndexEndValue) $output[$arrayIndexEndValue--] = $row;
else $output[] = $row;
}
if(count($output)==1) return $output[0];
if(count($output)==1) {
if(isset($arrayIndexEndValue)) return $output;
else return $output[0];
}
return $output;
}