* @return ADOFetchObj the object containing the fetched information
*/
function rs_fetch_record(&$rs) {
-
global $CFG;
+ if (!$rs) {
+ debugging('Incorrect $rs used!', DEBUG_DEVELOPER);
+ return false;
+ }
+
$rec = $rs->FetchObj(); //Retrieve record as object without advance the pointer
if ($rs->EOF) { //FetchObj requires manual checking of EOF to detect if it's the last record
* @return boolean true if the movement was successful and false if not (end of recordset)
*/
function rs_next_record(&$rs) {
+ if (!$rs) {
+ debugging('Incorrect $rs used!', DEBUG_DEVELOPER);
+ return false;
+ }
return $rs->MoveNext(); //Move the pointer to the next record
}
global $CFG;
- if (empty($rs)) {
- debugging('Incorrect rs used!');
+ if (!$rs) {
+ debugging('Incorrect $rs used!', DEBUG_DEVELOPER);
return false;
}
* @return bool
*/
function rs_EOF($rs) {
+ if (!$rs) {
+ debugging('Incorrect $rs used!', DEBUG_DEVELOPER);
+ return true;
+ }
return $rs->EOF;
}
*/
function rs_close(&$rs) {
if (!$rs) {
- // recordset not open, hmmm
+ debugging('Incorrect $rs used!', DEBUG_DEVELOPER);
return;
}