You are here: Re: Using mysql_result() Deletes Row From Result « PHP Programming Language « IT news, forums, messages
Re: Using mysql_result() Deletes Row From Result

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация