NYCPHP Meetup

NYPHP.org

[nycphp-talk] Handling MySQL result sets

Adam Maccabee Trachtenberg adam at trachtenberg.com
Thu Oct 30 01:14:53 EST 2003


On Wed, 29 Oct 2003, Michael Myers wrote:

> I have two MySQL result sets to handle when rendering a web
> page. One contains a set of Topics, each with one or more
> identifiers that point to relevant information. The other result set
> contains the information for each identifier.

> I render the page according the alphabetical order of the topics. I
> dealt that within the SQL query. In order to directly access the data
> for each identifier and speed things up, I built an index where the key
> is the identifier and the value is the row number in the result object.

The "best" solution is probably for you to do some sort of SQL JOIN
here. This will condense the two result sets into one. Or am I
misunderstanding what's going on here? I guess it depends upon the
size of your keyed information and how (un)common it is.

-adam

-- 
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!



More information about the talk mailing list