GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Teng::Plugin::Count(3) User Contributed Perl Documentation Teng::Plugin::Count(3)

Teng::Plugin::Count - Count rows in database.

    package MyDB;
    use parent qw/Teng/;
    __PACKAGE__->load_plugin('Count');

    package main;
    my $db = MyDB->new(...);
    $db->count('user'); # => The number of rows in 'user' table.
    $db->count('user', '*', {type => 2}); # => SELECT COUNT(*) FROM user WHERE type=2

This plugin provides shorthand for counting rows in database.

$db->count($table[, $column[, \%where]]) : Int
$table table name for counting

$column Column name for "COUNT(...)", the default value is '*'.

\%where : HashRef for creating where clause. The format is same as "$db->select()". This parameter is optional.

Return: The number of rows.

2020-03-25 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.