MINOR: return false rather than error out in case SS_Query:: is not a resource (from r107030)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112544 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-10-15 03:07:39 +00:00
parent a0424ccd3e
commit 997a86b7e0

View File

@ -1073,11 +1073,11 @@ class MySQLQuery extends SS_Query {
}
public function seek($row) {
return mysql_data_seek($this->handle, $row);
return is_resource($this->handle) ? mysql_data_seek($this->handle, $row) : false;
}
public function numRecords() {
return mysql_num_rows($this->handle);
return is_resource($this->handle) ? mysql_num_rows($this->handle) : false;
}
public function nextRecord() {