version 1.16, 2003/12/26 19:12:51
|
version 1.19, 2004/03/03 17:19:06
|
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 912 sub tables_in_db {
|
Line 932 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); |
} |
} |
|
|
########################################### |
########################################### |
Line 1002 sub remove_from_table {
|
Line 1024 sub remove_from_table {
|
return undef if (!defined(&connect_to_db())); |
return undef if (!defined(&connect_to_db())); |
# |
# |
$table_id = &translate_id($table_id); |
$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); |
" LIKE BINARY ".$dbh->quote($value); |
my $sth = $dbh->prepare($command); |
my $sth = $dbh->prepare($command); |
$sth->execute(); |
unless ($sth->execute()) { |
if ($sth->err) { |
|
$errorstring = "ERROR on execution of ".$command."\n".$sth->errstr; |
$errorstring = "ERROR on execution of ".$command."\n".$sth->errstr; |
return undef; |
return undef; |
} |
} |