note 94873 modified in class.sqlite3result by thiago
| From: | thiago@php.net | Date: | Mon, 30 Nov 2009 12:00:55 +0000 |
| Subject: | note 94873 modified in class.sqlite3result by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163397@lists.php.net to get a copy of this message | ||
Since SQLite3Result::numRows is unavailable, use:
<?php
if ($res->numColumns() && $res->columnType(0) != SQLITE3_NULL) {
// have rows
} else {
// zero rows
}
?>
Because when there are zero rows:
* SQLite3Result::fetchArray will return '1'
* SQLite3Result::numColumns will return '1'
* Column type for column '0' will be SQLITE3_NULL
--was--
Since SQLite3Result::numRows is unavailable, use:
if ($res->numColumns() && $res->columnType(0) != SQLITE3_NULL) {
// have rows
} else {
// zero rows
}
Because when there are zero rows:
* SQLite3Result::fetchArray will return '1'
* SQLite3Result::numColumns will return '1'
* Column type for column '0' will be SQLITE3_NULL
http://php.net/manual/en/class.sqlite3result.php