How To Use DBIx::SQLEngine To Get A Count
1 2 3 4 5 6 7 |
my $value = $dbh->fetch_one_value( 'table' => 'users', 'columns' => 'COUNT(*)', 'where' => { 'active' => 1, }, ); |
1 2 3 4 5 6 7 |
my $value = $dbh->fetch_one_value( 'table' => 'users', 'columns' => 'COUNT(*)', 'where' => { 'active' => 1, }, ); |
First, make sure MySQL server has the time zone tables loaded, which are NOT there by default!
1 2 |
# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql # service mysqld restart |
Next, tell MySQL to use the desired time zone via Perl:
1 2 |
my $dbh = DBIx::SQLEngine->new( ${dsn}, '{login}', '{passwd}' ); $dbh->do_sql("SET time_zone = 'America/New_York';"); |
MySQL TimeZone Support Info MySQL Date and Time Functions
Found that DBIx::Wrapper was BROKEN BADLY – now using DBIx::SQLEngine with great success… Just had our first successful test from the database through JSON to the javascript front-end. Very nice. Zooooooooom!