From: Brian W. <br...@uc...> - 2004-04-09 19:12:01
|
Is it possible that $counts could contain indexes other than the ones returned by the query? Maybe the purpose is to reset just certain elements of the $counts array... Brian Wood Programmer/Analyst UC Berkeley Human Resources At 06:11 PM 4/8/2004, Erek Dyskant wrote: >Hi All, > this is a snippet from survey_results.inc: > Line 406: > $sql = "SELECT C.content FROM question_choice C > WHERE C.question_id='${qid}' AND C.content NOT > LIKE '!other%' > ORDER BY C.id"; > if ($result = mysql_query($sql)) { > for ($j = 0; $j < mysql_num_rows($result); $j++) > $counts[mysql_result($result, $j, 0)] = null; > mysql_free_result($result); > } > > The only thing that I see this does is enumerates through the > $counts array and resets everything to null, >would it be better to change this to one line: $counts = array(); > I have done this in my developement copy with no ill effects. >Any of you know another purpose to this block? > > >Regards, >Erek Dyskant > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >_______________________________________________ >phpESP-devel mailing list >php...@li... >https://lists.sourceforge.net/lists/listinfo/phpesp-devel |