<?xml version="1.0" encoding="windows-1252"?>
<node id="689395" title="Re: Single mysql query" created="2008-05-31 02:08:18" updated="2008-05-30 22:08:18">
<type id="11">
note</type>
<author id="25823">
jaldhar</author>
<data>
<field name="doctext">
&lt;p&gt;DBI has a number of functions that let you bypass having to code a loop. (Behind the scenes they are looping so these are just shortcuts really.)&lt;/p&gt;
&lt;p&gt;if you know you're only going to get one row  back, selectrow_array (or _arrayref or _hashref) does the prepare, execute, and fetch all in one go for you.&lt;/p&gt;
&lt;p&gt;If you want an arrayref of arrayrefs or hashrefs (each representing one row,) the selectall_arrayref or selectall_hashref functions combine prepare, execute, and fetch into one function for you.&lt;/p&gt;
&lt;p&gt;If you only want certain columns from each row returned as an array of arrayrefs (each representing the selected columns in one row, selectcol_arrayref does the prepare, execute, and fetch in one go just like the other functions.&lt;/p&gt;

&lt;div class="pmsig"&gt;&lt;div class="pmsig-25823"&gt;
&lt;p&gt;-- &lt;br&gt;&amp;#2716;&amp;#2738;&amp;#2727;&amp;#2736;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
689388</field>
<field name="parent_node">
689388</field>
</data>
</node>
