--- nfo/php/libs/com.newsblob.phphtmllib/widgets/data_list/ADODBSQLDataListSource.inc 2003/01/30 03:29:46 1.1
+++ nfo/php/libs/com.newsblob.phphtmllib/widgets/data_list/ADODBSQLDataListSource.inc 2004/05/06 12:59:55 1.2
@@ -82,14 +82,27 @@
$this->_db = &$db;
}
+ /**
+ * This is the function that does the data fetching,
+ * and sorting if needed.
+ * If the source is a sql database, this is where the
+ * query gets called. This function doesn't actually read the
+ * data from the DB yet. That is what get_next_data_row()
+ * does.
+ *
+ * @return boolean - the query passed/failed.
+ */
function do_query() {
$this->_result = $this->_db->SelectLimit($this->_query,
$this->get_limit(),
$this->get_offset());
if (!$this->_result) {
- $msg = $this->_result->ErrorMsg();
+ $msg = $this->_db->ErrorMsg();
user_error("ADODBSQLDataListSource::do_query() - query failed : ".$msg);
- }
+ return false;
+ } else {
+ return true;
+ }
}
@@ -128,7 +141,7 @@
$query = "select count(".$count_clause.") as COUNT from ".$tables." ".$where_clause;
$result = $this->_db->Execute($query);
if (!$result) {
- $msg = $result->ErrorMsg();
+ $msg = $this->_db->ErrorMsg();
user_error("ADODBSQLDataListSource::count() - query failed : ".$msg);
}
$value = $result->FetchRow();