More than one mysql_fetch_array()

sophayyyyyyy

New Member
CODE1: \[code\]while( $row1 = mysql_fetch_array($result2) && $row2 = mysql_fetch_array($result4) ){ $details[0] = $row1[0]; $details[1] = $row2[0]; var_dump($details[0]); var_dump($details[1]);}\[/code\]OUTPUT1: \[code\]NULL string(1) "5" \[/code\]CODE2: \[code\]while($row1 = mysql_fetch_array($result2)){ $details[0] = $row1[0]; var_dump($details[0]);}while($row2 = mysql_fetch_array($result4)){ $details[1] = $row2[0]; var_dump($details[1]);}\[/code\]OUTPUT2: \[code\]string(6) "728548" string(1) "5"\[/code\]\[code\]**OUTPUT2**\[/code\] is the desired result. I have checked the rest portion of my code that I haven't mentioned here, nothing is wrong with that. Using \[code\]**CODE1**\[/code\] instead of \[code\]**CODE2**\[/code\] gives wrong result. I tried \[code\]**CODE1**\[/code\] just for reducing the length of my code but it isn't working. Why can't we use more than one \[code\]mysql_fetch_array()\[/code\] like I did in \[code\]**CODE1**\[/code\] ?
 
Back
Top