]>
Commit | Line | Data |
---|---|---|
9ee90455 AD |
1 | <?php |
2 | class Db_Stmt { | |
3 | private $stmt; | |
4 | private $cache; | |
5 | ||
6 | function __construct($stmt) { | |
7 | $this->stmt = $stmt; | |
8 | $this->cache = false; | |
9 | } | |
10 | ||
11 | function fetch_result($row, $param) { | |
12 | if (!$this->cache) { | |
13 | $this->cache = $this->stmt->fetchAll(); | |
14 | } | |
15 | ||
16 | if (isset($this->cache[$row])) { | |
17 | return $this->cache[$row][$param]; | |
18 | } else { | |
19 | user_error("Unable to jump to row $row", E_USER_WARNING); | |
20 | return false; | |
21 | } | |
22 | } | |
23 | ||
24 | function rowCount() { | |
25 | return $this->stmt->rowCount(); | |
26 | } | |
27 | ||
28 | function fetch() { | |
29 | return $this->stmt->fetch(); | |
30 | } | |
31 | } | |
32 | ?> |