RE: how to reuse DB results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Richard!

Thanks.

Ok.. let me see if I got this straight....

Db_query...
While($results)
{

	$resultset[] = $results;

}

//display initial data needed
echo "{$resultset[0]} {"{$resultset[3]}";

//display full results further down page
reset($resultset);

while($resultset)
{

	//display full result set here

}


Is my logic right or completely off base?

Thanks!

A



> -----Original Message-----
> From: Hutchins, Richard [mailto:Richard.Hutchins@xxxxxxxxxxxxxx]
> Sent: May 20, 2004 4:19 PM
> To: php-db@xxxxxxxxxxxxx
> Subject: RE:  how to reuse DB results
> 
> Off the top of my head, you could do the db call once, assign the full
> result set to an array, pull off the parts you want at the top of the
> page,
> then use reset($arrayname) to put the pointer back to the beginning of
the
> array then use a loop to print out the whole thing at the bottom of
the
> page.
> 
> That's just one way though. There are probably others available with
and
> without the use of a db abstraction class.
> 
> HTH,
> Rich
> 
> > -----Original Message-----
> > From: Aaron Wolski [mailto:aaronjw@xxxxxxxxxxxxx]
> > Sent: Thursday, May 20, 2004 4:14 PM
> > To: php-db@xxxxxxxxxxxxx
> > Subject:  how to reuse DB results
> >
> >
> > 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 (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux