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

www lon-capa-cvs@mail.lon-capa.org
Sat, 27 Dec 2003 01:44:49 -0000


www		Fri Dec 26 20:44:49 2003 EDT

  Modified files:              
    /loncom/interface	lonmysql.pm 
  Log:
  column in DELETE cannot have quotes.
  
  
Index: loncom/interface/lonmysql.pm
diff -u loncom/interface/lonmysql.pm:1.16 loncom/interface/lonmysql.pm:1.17
--- loncom/interface/lonmysql.pm:1.16	Fri Dec 26 14:12:51 2003
+++ loncom/interface/lonmysql.pm	Fri Dec 26 20:44:49 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # MySQL utility functions
 #
-# $Id: lonmysql.pm,v 1.16 2003/12/26 19:12:51 www Exp $
+# $Id: lonmysql.pm,v 1.17 2003/12/27 01:44:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1002,11 +1002,10 @@
     return undef if (!defined(&connect_to_db()));
     #
     $table_id = &translate_id($table_id);
-    my $command = 'DELETE FROM '.$table_id.' WHERE '.$dbh->quote($column).
+    my $command = 'DELETE FROM '.$table_id.' WHERE '.$column.
         " LIKE BINARY ".$dbh->quote($value);
     my $sth = $dbh->prepare($command); 
-    $sth->execute();
-    if ($sth->err) {
+    unless ($sth->execute()) {
         $errorstring = "ERROR on execution of ".$command."\n".$sth->errstr;
         return undef;
     }