returning array and message to function
<p>please help me out regarding this function.  I want to fetch data from the database and if there are results, I want to return a message and data array.</p>

<pre><code>    $this-&gt;query=("select * from user where pno='".$search."'");
    $rd = $this-&gt;executeQuery();
    $data = $rd-&gt;fetch_assoc();


    if ($data) {
        $message = "Record found.";
    } else {
        $message = "Record not found.";
    }
return array($data, $message);
</code></pre>

<p>I am calling it this way:</p>

<pre><code>list($data, $message)=$user-&gt;search($result);

echo $message
echo $data['name'];
</code></pre>

<p>I am getting the message but I am unable to fetch the array.
Please help me out if there is a problem in the function or if I can improve it.</p>
