PHP Array problems....if anyone can assist!
<p>Thanks for the contributions so far - I can see now that $rowq is not a single array but lots of them - I'd like to bring all the rows back in the array, any suggestions?</p>

<p>First off, the code which brings back my data into an array:</p>

<pre><code>function fetch_questions($page) {
global $link;
$proc = mysqli_prepare($link, "SELECT * FROM tques WHERE page = ?");
mysqli_stmt_bind_param($proc, "i", $page);
mysqli_stmt_execute($proc);


$rowq = array();
stmt_bind_assoc($proc, $rowq);

// loop through all result rows
while ($proc-&gt;fetch()) {
//      print_r($rowq);
}


mysqli_stmt_close($proc);
mysqli_clean_connection($link);
return($rowq);
} 
</code></pre>

<p>Now, when I `print_r($rowq);'  I get the following, which is all good:</p>

<p><code>Array ( [questions] =&gt; q1 [qnum] =&gt; 1 [qtext] =&gt; I find my job meaningful [page] =&gt; 1 ) Array ( [questions] =&gt; q2 [qnum] =&gt; 2 [qtext] =&gt; I find my job interesting [page] =&gt; 1 ) Array ( [questions] =&gt; q3 [qnum] =&gt; 3 [qtext] =&gt; My work supports ABC's objective [page] =&gt; 1 ) Array ( [questions] =&gt; q4 [qnum] =&gt; 4 [qtext] =&gt; I am able to balance my work and home life [page] =&gt; 1 ) Array ( [questions] =&gt; q5 [qnum] =&gt; 5 [qtext] =&gt; I am clear about what is expected of me in my job [page] =&gt; 1 ) Array ( [questions] =&gt; q6 [qnum] =&gt; 6 [qtext] =&gt; My induction helped me to settle into my job [page] =&gt; 1 ) Array ( [questions] =&gt; q7 [qnum] =&gt; 7 [qtext] =&gt; I understand the ABC vision [page] =&gt; 1 ) Array ( [questions] =&gt; q8 [qnum] =&gt; 8 [qtext] =&gt; I know how what I do fits into my team's objectives [page] =&gt; 1 )</code></p>

<p>Now, in my php page I have the following piece of script:</p>

<p><code>$questions = fetch_questions($page);</code>  </p>

<p>And when I print_r $questions, as below:</p>

<p><code>print_r($questions);</code></p>

<p>I only get the following back from the array, 1 row:</p>

<p><code>Array ( [questions] =&gt; q8 [qnum] =&gt; 8 [qtext] =&gt; I know how what I do fits into my team's objectives [page] =&gt; 1 )</code></p>

<p>Any ideas why that might be?</p>

<p>Thanks in advance,</p>

<p>Homer.</p>
