Commit | Line | Data |
---|---|---|
51ff3226 | 1 | <?php |
78f1a5f4 H |
2 | |
3 | class result extends PDOStatement { | |
4 | //All functions in this class are deprecated! | |
5 | //Please use only native PDOStatement functions! | |
6 | ||
51ff3226 | 7 | var $_numRows = 0; |
8 | var $_numFields = 0; | |
9 | var $_currentRow = -1; | |
10 | var $_currentRecord = array(); | |
11 | var $_queryId = false; | |
12 | var $_sql = ""; | |
13 | ||
78f1a5f4 H |
14 | public $dbh; |
15 | protected function __construct($dbh) { | |
16 | $this->dbh = $dbh; | |
17 | ||
18 | $this->_numRows = @$this->rowCount(); | |
19 | //$this->_numFields = @mysql_num_fields($this->_queryId); | |
51ff3226 | 20 | $this->_currentRow = -1; |
21 | $this->_currentRecord = array(); | |
51ff3226 | 22 | } |
51ff3226 | 23 | |
78f1a5f4 H |
24 | function next() { //DEPRECATED!!! Use $this->fetch(); instead!!! |
25 | if ($this->_currentRow + 1 >= $this->_numRows) { | |
26 | return false; | |
27 | } else { | |
28 | $this->_currentRecord = @$this->fetch(); | |
29 | $this->_currentRow++; | |
30 | return true; | |
31 | } | |
51ff3226 | 32 | } |
51ff3226 | 33 | |
78f1a5f4 H |
34 | function getRecord() { //DEPRECATED!!! Use $this->fetch(); instead!!! |
35 | return $this->_currentRecord; | |
51ff3226 | 36 | } |
51ff3226 | 37 | |
78f1a5f4 H |
38 | function getString($column) { //DEPRECATED!!! Use $this->fetch(); instead!!! |
39 | if (is_int($column) == true) { | |
40 | return (string) $this->_currentRecord[$column - 1]; | |
41 | } else { | |
42 | return (string) $this->_currentRecord["$column"]; | |
43 | } | |
51ff3226 | 44 | } |
51ff3226 | 45 | |
78f1a5f4 | 46 | function getInt($column) { //DEPRECATED!!! Use $this->fetch(); instead!!! |
5e495f9a | 47 | return $this->getString($column); //Dynamic typing OMG... |
51ff3226 | 48 | } |
51ff3226 | 49 | |
78f1a5f4 H |
50 | function getNumRows() { //DEPRECATED!!! Use $this->rowCount(); instead!!! |
51 | return $this->_numRows; | |
51ff3226 | 52 | } |
51ff3226 | 53 | |
54 | } | |
55 |