mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 17:05:37 +02:00
return 0 for non iterable results
If there are no columns, it's not a iterable result set and we can return 0. This fixes issues with things like CREATE statement.
This commit is contained in:
parent
b36f3598bb
commit
978c371820
@ -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