View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
149 | PHPOF2 | Default | public | 21 Jan 2009 09:45 | 16 Apr 2009 07:29 |
Reporter | mrosenquist | Assigned To | timj | ||
Priority | normal | Severity | feature | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Target Version | 0.11.1 | Fixed in Version | 0.11.1 | ||
Summary | 149: Add DBTable::numRows() function | ||||
Description | add hasRows() and/or countRows() to DBTable hasRows() Returns boolean false if there are no values in the table public function hasRows() { $sql = 'SELECT count(*) FROM ' . $this->db->quoteIdentifier($this->name) . ' LIMIT 1'; $count = $this->db->queryOne($sql); return (int)$count == 1; } countRows()Returns int number of the rows for the table public function hasRows() { $sql = 'SELECT count(*) FROM ' . $this->db->quoteIdentifier($this->name); return (int)$this->db->queryOne($sql); } | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
21 Jan 2009 09:45 | mrosenquist | New Issue | |
15 Apr 2009 13:31 | timj | Target Version | => 0.11.1 |
15 Apr 2009 18:32 | timj | Note Added: 195 | |
15 Apr 2009 18:32 | timj | Assigned To | => timj |
15 Apr 2009 18:32 | timj | Status | new => resolved |
15 Apr 2009 18:32 | timj | Resolution | open => fixed |
15 Apr 2009 18:32 | timj | Fixed in Version | => 0.11.1 |
15 Apr 2009 18:32 | timj | Summary | add hasRows() and/or countRows() to DBTable => Add DBTable::numRows() function |
16 Apr 2009 07:29 | timj | Status | resolved => closed |