|
Posted by Jerry Stuckle on 09/11/06 03:25
Steve wrote:
>> Another option would be to run a query to fetch just the category
>> description, rather than return it in every single row (just to save a
>> query). At some point the extra data returned will take longer than a
>> second select statement.
>
>
> I thought about doing that, but it seemed more efficient to try to get
> everything with one query.
>
> Thanks for your help.
>
> Steve
Yep, you can do it in one query. Something like:
$category = null;
....
while ($row2 = mysql_fetch_array($result2)) {
if ($category == null)
$category = $row2['Category'];
... Rest of processing
}
BTW - this construct is better, IMHO, then getting the number of rows
and using a for loop.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|