php, how to find and copy specific line(s)/rows of 2 dimensional array into another array for processing
<p>sorry, my brain doesn't do arrays, pointers and oop - so far i managed to cope with simple 1-line 'record' type arrays and old structured programming methods.</p>

<p>BUT i now need to deal with a 2-dimensional table type array following a mysql query.</p>

<p>here is what i need to do:</p>

<ol>
<li><p>get mysql returned records in array to another array eg.</p>

<pre><code>   while ( $row = @mysql_fetch_array($result_35bid, MYSQL_BOTH) )  //-- done
   {
</code></pre></li>
<li><p>copy $row to another array;</p>

<pre><code>                     $rowcopy = array();
         $rowcopy = $row;             //-- i think i have done ok
</code></pre></li>
<li><p>now i need to find all a specific value contained in a field name 'domname' and copy this row/line to another array. so how do i do this?? from my $rowcopy to a new array. so, i need to find every row that has a field value say 'mydomain' from the field name domname and copy this into the new array, $newArray.</p></li>
</ol>

<p>i have tried this but it fails:</p>

<pre><code>           $newArray = array();
       $newline = 0;
        for( $i = 0; $i &lt; count($rowcopy); $i++ )
        {

            if ( $rowcopy['domname'] == 'mydomain'  )
            {
                $newline ++;

                   $newArray[$newline] = $rowcopy[$I];
                                   //-- copy this row to new array

                                   //-- i think my problem is here ??

            }

        } // end-for

    print_r($newArray);

       } // end-while
</code></pre>

<p>this should result in a subset of the $rowcopy containing all records/rows that have a field value 'mydomain' in the field/key 'domname' to the new smaller array, $newArray.</p>

<p>[ in. mysql terms, i need to find all records that conatin a certain domain name - but this i need to do in php using arrays as this is a follow on from a mysql query alreday performed ]</p>

<p>any help appreciated.</p>

<p>thank you.</p>
