Skip to content

Commit 95f2456

Browse files
committed
fix: Connection::getPRow fetches only a single row instead of a whole table
1 parent b823210 commit 95f2456

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Connection.php

+3-7
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,9 @@ public function getPRow($strQuery, $arrParams = [], $intNr = 0, $bitCache = true
327327
trigger_error("The intNr parameter is deprecated", E_USER_DEPRECATED);
328328
}
329329

330-
$arrTemp = $this->getPArray($strQuery, $arrParams, null, null, $bitCache, $arrEscapes);
331-
332-
if (isset($arrTemp[$intNr])) {
333-
return $arrTemp[$intNr];
334-
} else {
335-
return [];
336-
}
330+
$resultRow = $this->getPArray($strQuery, $arrParams, $intNr, $intNr, $bitCache, $arrEscapes);
331+
$value = current($resultRow);
332+
return $value !== false ? $value : [];
337333
}
338334

339335
/**

0 commit comments

Comments
 (0)