July 1999
Intermediate to advanced
502 pages
19h 52m
English
Msql::Statement::numrows
$number_of_rows = $statement_handle->numrows;
Msql::Statement::numrows returns the number of
rows contained in the statement handle. If run on a statement handle
that cannot contain any rows, such as one returned by
Msql::listfields, the function returns the string
`N/A.’ If the statement handle could contain rows but
does not, such as one returned by a SELECT that
does not match any fields, the function returns 0.
use Msql;
my $db = Msql->connect;
$db->selectdb('mydata');
my $output = $db->query("select * from mytable");
my $numrows = $output->numrows;
print "There are $numrows rows of data in 'mytable'\n";Read now
Unlock full access