[LON-CAPA-cvs] cvs: loncom /interface lonmysql.pm

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 14 Mar 2003 15:37:02 -0000


matthew		Fri Mar 14 10:37:02 2003 EDT

  Modified files:              
    /loncom/interface	lonmysql.pm 
  Log:
  Added &get_dbh() to allow the user direct access to the dbh.
  
  
Index: loncom/interface/lonmysql.pm
diff -u loncom/interface/lonmysql.pm:1.9 loncom/interface/lonmysql.pm:1.10
--- loncom/interface/lonmysql.pm:1.9	Thu Mar 13 14:08:52 2003
+++ loncom/interface/lonmysql.pm	Fri Mar 14 10:37:02 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # MySQL utility functions
 #
-# $Id: lonmysql.pm,v 1.9 2003/03/13 19:08:52 matthew Exp $
+# $Id: lonmysql.pm,v 1.10 2003/03/14 15:37:02 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -395,6 +395,26 @@
     return undef if (! defined(&connect_to_db()));
     return undef if (! defined(&update_table_info($table_id)));
     return $Tables{&translate_id($table_id)}->{'Rows'};
+}
+###############################
+
+=pod
+
+=item &get_dbh()
+
+Input: nothing
+
+Returns: the database handler, or undef on error.
+
+This routine allows the programmer to gain access to the database handler.
+Be careful.
+
+=cut
+
+###############################
+sub get_dbh { 
+    return undef if (! defined(&connect_to_db()));
+    return $dbh;
 }
 
 ###############################