CODE1:
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]);
}
OUTPUT1:
NULL string(1) "5"
CODE2:
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]);
}
OUTPUT2:
string(6) "728548" string(1) "5"
**OUTPUT2**
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 **CODE1**
instead of **CODE2**
gives wrong result. I tried **CODE1**
just for reducing the length of my code but it isn't working. Why can't we use more than one mysql_fetch_array()
like I did in **CODE1**
?