Diff for /loncom/interface/lonmysql.pm between versions 1.17 and 1.20

version 1.17, 2003/12/27 01:44:49 version 1.20, 2004/04/19 21:29:15
Line 559  sub update_table_info { Line 559  sub update_table_info {
     $debugstring = "Retrieved table info for $tablename";      $debugstring = "Retrieved table info for $tablename";
     return 1;      return 1;
 }  }
   ###############################
   
   =pod
   
   =item &col_order()
   
   Inputs: table id
   
   Returns: array with column order
   
   =cut
   
   
   sub col_order {
       my $table_id=shift;
       if (&update_table_info($table_id)) {
    return @{$Tables{$table_id}->{'Col_order'}};
       } else {
    return ();
       }
   }
 ###############################  ###############################
   
 =pod  =pod
Line 694  sub create_table { Line 714  sub create_table {
     #############################################      #############################################
     my $count = $dbh->do($request);      my $count = $dbh->do($request);
     if (! defined($count)) {      if (! defined($count)) {
         $errorstring = "$dbh ATTEMPTED:\n".$request."\nRESULTING ERROR:\n";          $errorstring = "$dbh ATTEMPTED:\n".$request."\nRESULTING ERROR:\n".
               $dbh->errstr();
         return undef;          return undef;
     }      }
     #      #
Line 912  sub tables_in_db { Line 933  sub tables_in_db {
     return undef if (!defined(&connect_to_db()));      return undef if (!defined(&connect_to_db()));
     my $sth=$dbh->prepare('SHOW TABLES');      my $sth=$dbh->prepare('SHOW TABLES');
     $sth->execute();      $sth->execute();
     if ($sth->err) {      $sth->execute();
         $errorstring = "$dbh ATTEMPTED:\n".'SHOW TABLES'.      my $aref = $sth->fetchall_arrayref;
       if ($sth->err()) {
           $errorstring = 
               "$dbh ATTEMPTED:\n".'fetchall_arrayref after SHOW TABLES'.
             "\nRESULTING ERROR:\n".$sth->errstr;              "\nRESULTING ERROR:\n".$sth->errstr;
         return undef;          return undef;
     }      }
     my $aref = $sth->fetchall_arrayref;      my @table_list;
     my @table_list=();  
     foreach (@$aref) {      foreach (@$aref) {
         push @table_list,$_->[0];          push(@table_list,$_->[0]);
     }      }
     $debugstring = "Got list of tables in DB: @table_list";      $debugstring = "Got list of tables in DB: ".join(',',@table_list);
     return @table_list;      return(@table_list);
 }  }
   
 ###########################################  ###########################################

Removed from v.1.17  
changed lines
  Added in v.1.20


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>