mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 17:05:37 +02:00
Merge pull request #43 from lekoala/patch-1
return 0 for non iterable results
This commit is contained in:
commit
c346e64590
@ -58,6 +58,11 @@ class SQLite3Query extends Query
|
|||||||
*/
|
*/
|
||||||
public function numRecords()
|
public function numRecords()
|
||||||
{
|
{
|
||||||
|
// Some queries are not iterable using fetchArray like CREATE statement
|
||||||
|
if (!$this->handle->numColumns()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
$this->handle->reset();
|
$this->handle->reset();
|
||||||
$c=0;
|
$c=0;
|
||||||
while ($this->handle->fetchArray()) {
|
while ($this->handle->fetchArray()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user