The array it is fetching has size 2 , so if we comment out $size it returns 2 , but the for loop prints only the value present at 0th position of table column and not the next at 2th giving the error:
Undefined offset: 1
Code:
$allunstitched="Select p_id from unstitchedproduct";
$resultAllUnstitched= mysqli_query($connection,$allunstitched);
$AllUnstitchedResult= mysqli_fetch_array($resultAllUnstitched);
//$size=count($AllUnstitchedResult);
for ($i=0, $count = count($AllUnstitchedResult); $i < $count; ++$i) {
print $AllUnstitchedResult[$i];
}