Name

Msql::Statement::name

Synopsis

@column_names  = $statement_handle->name;

Msql::Statement::name returns the names of the columns of data contained in the statement handle. When called in a scalar context the function returns a reference to an array. As with Msql::Statement::table, the scalar value of this list (as opposed to the value of the function when called in a scalar context) is identical to the value of Msql::Statement::numfields.

Example

use Msql;
my $db = Msql->connect;
$db->selectdb('mydata');
my $output = $db->query("select * from mytable");

my @column_names = $output->names;
# @column_names is now a list of the columns in 'mytable'

Get MySQL and mSQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.