<?xml version="1.0" encoding="windows-1252"?>
<node id="464996" title="Select COUNT in MySQL" created="2005-06-09 04:01:46" updated="2005-06-16 18:26:34">
<type id="115">
perlquestion</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
Hi Monks,
&lt;br&gt;&lt;br&gt;
I want to find the quickest possible way to count the number of rows in a mysql db.
&lt;br&gt;&lt;br&gt;
Heres part of my code that returns this "ARRAY(0x1ae8674)"
&lt;code&gt;
	my $sqlc = "SELECT COUNT(*) FROM company_info";
        my $crows= $dbh-&gt;selectrow_arrayref($sqlc);
			print $crows;

#I did not use prepare or execute since I heard selectrow_arrayref wraps it around

&lt;/code&gt;
I also tried using print $crows[0], but then it says it requires global symbol @crows.
&lt;br&gt;&lt;br&gt;
What am I doing wrong?
&lt;Br&gt;&lt;br&gt;
Since this code and sql statement will only generate 1 row returned with 1 column--would selectcol_arrayref be better then selectrow_arrayref ?
&lt;br&gt;&lt;br&gt;
Thanks</field>
<field name="reputation">
12</field>
</data>
</node>
