Sorry for mystakes, ....(shame on me, i said i was new) using Object array,
here is a working version (tested) with use of array.


$recordset=mysql_query('SELECT * FROM my_tabella'); // or whatever query is

/* define an array with fields to be shown on top of page. Attention
...values name must be the same of table field names you want to show on top
of the page*/
$my_key = array('key01','key02','key03'); /* u can use $_REQUEST variables
instead of
fixed values*/
while($record=mysql_fetch_array($recordset, MYSQL_ASSOC))
    foreach ($record as $k=>$val)
        if ($k==$my_key[$i])
            // echo the top of the page
            echo "<p>$k :$val</p>";
            /* if u need a top_array to store result shown on top of the
page, comment this line only
            $top_array[$i]=$val; // loose the matching key<->field!! */

//reset the resource

// some middle-page code here

echo '<p>this is the bottom page and displays the whole result</p>';
while ($record=mysql_fetch_array($recordset, MYSQL_ASSOC))
    foreach ($record as $k=>$val)
        echo "<p>$k : $val</p>"; // make your choice for html code


// Bye

"Aaron Wolski" <[EMAIL PROTECTED]> ha scritto nel messaggio
> Hi All,
> Got this logic problem I don't know how to solve.
> Is there any way I can make a call to the DB for some records.
> Display some info from a column or two say at the top of the page and
> then display the full result set in a while() loop?
> Right now, I am making two calls to the Db to get the data I need to
> display at the top of the page and then a second query to retrieve the
> full result set.
> I'm confused!
> Thanks for any help!
> Aaron

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to