82 |
$this->_db = &$db; |
$this->_db = &$db; |
83 |
} |
} |
84 |
|
|
85 |
|
/** |
86 |
|
* This is the function that does the data fetching, |
87 |
|
* and sorting if needed. |
88 |
|
* If the source is a sql database, this is where the |
89 |
|
* query gets called. This function doesn't actually read the |
90 |
|
* data from the DB yet. That is what get_next_data_row() |
91 |
|
* does. |
92 |
|
* |
93 |
|
* @return boolean - the query passed/failed. |
94 |
|
*/ |
95 |
function do_query() { |
function do_query() { |
96 |
$this->_result = $this->_db->SelectLimit($this->_query, |
$this->_result = $this->_db->SelectLimit($this->_query, |
97 |
$this->get_limit(), |
$this->get_limit(), |
98 |
$this->get_offset()); |
$this->get_offset()); |
99 |
if (!$this->_result) { |
if (!$this->_result) { |
100 |
$msg = $this->_result->ErrorMsg(); |
$msg = $this->_db->ErrorMsg(); |
101 |
user_error("ADODBSQLDataListSource::do_query() - query failed : ".$msg); |
user_error("ADODBSQLDataListSource::do_query() - query failed : ".$msg); |
102 |
} |
return false; |
103 |
|
} else { |
104 |
|
return true; |
105 |
|
} |
106 |
} |
} |
107 |
|
|
108 |
|
|
141 |
$query = "select count(".$count_clause.") as COUNT from ".$tables." ".$where_clause; |
$query = "select count(".$count_clause.") as COUNT from ".$tables." ".$where_clause; |
142 |
$result = $this->_db->Execute($query); |
$result = $this->_db->Execute($query); |
143 |
if (!$result) { |
if (!$result) { |
144 |
$msg = $result->ErrorMsg(); |
$msg = $this->_db->ErrorMsg(); |
145 |
user_error("ADODBSQLDataListSource::count() - query failed : ".$msg); |
user_error("ADODBSQLDataListSource::count() - query failed : ".$msg); |
146 |
} |
} |
147 |
$value = $result->FetchRow(); |
$value = $result->FetchRow(); |