Unkown error type: [2048] date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead /usr/httpd/scarson/codedog.com/include/classPage.php 59
Code Dog

This site's design is only visible in a graphical browser that supports web standards, but its content is accessible to any browser or Internet device.

Get Max Fields Lengths

#!/usr/bin/perl
use DBI;
my $dsn = "DBI:mysql:dbname";
my $dbh = DBI->connect($dsn,"user","pass") or die "Could not connect to $dsn";
my $sth = $dbh->prepare("select * from tablename");
$sth->execute();
my (@wid) = @{$sth->{mysql_max_length}};
my (@col) = @{$sth->{NAME}};
my $ncols = scalar(@col);
my $i;
for($i=0; $i < $ncols; $i++) {
        $marker = ($wid[$i] == 0) ? "<==" : "";
        printf "%-20s\t%3d\t%s\n", $col[$i], $wid[$i], $marker;
}
$sth->finish();
$dbh->disconnect();

Script duration: 0.0595819950104