0); } //-------------------------------------------------------------------------------------------------- function save_next_reference($type, $reference) { $sql = "UPDATE ".TB_PREF."sys_types SET next_reference=" . db_escape(trim($reference)) . " WHERE type_id = $type"; db_query($sql, "The next transaction ref for $type could not be updated"); } //-------------------------------------------------------------------------------------------------- function get_next_reference($type) { $sql = "SELECT next_reference FROM ".TB_PREF."sys_types WHERE type_id = $type"; $result = db_query($sql,"The last transaction ref for $type could not be retreived"); $row = db_fetch_row($result); return $row[0]; } ?>