public static function execute_multiple($sql, $args = array(NULL)) { global $query_count_on_page; $db = Dal::get_connection(); $sql = Dal::validate_sql($sql); $prh = $db->prepare($sql); if (PEAR::isError($prh)) { Logger::log(" Throwing exception DB_QUERY_FAILED while preparing a query for multiple execution | Message: " . $prh->getMessage() . " | SQL that caused this exception: " . $sql, LOGGER_ERROR); throw new PAException(DB_QUERY_FAILED, $prh->getMessage()); } foreach ($args as $params) { Dal::execute_pre_hooks($sql, $params); $sth = $db->execute($prh, $params); Dal::execute_post_hooks($sql, $params); if (PEAR::isError($sth)) { Logger::log(" Throwing exception DB_QUERY_FAILED while in multiple query execution | Message: " . $sth->getMessage() . " | SQL that caused this exception: " . $sql, LOGGER_ERROR); throw new PAException(DB_QUERY_FAILED, $sth->getMessage()); } $query_count_on_page++; } $db->freePrepared($prh); return TRUE; }