while($row = mysqli_fetch_array($getCropsInvestor)){
$cropID = $row['CropID'];
$selectCrop = mysqli_query($con, "SELECT * FROM Crops WHERE ID=$cropID");
$fetchCropData = mysqli_fetch_array($selectCropData,MYSQLI_ASSOC);
if($fetchCropData){
echo 'Suc';
}
else{
echo 'Fail';
}
$checkAvail = $fetchCropData['Availability'];
Can someone explain to me why this code returns Fail
and a solution on how to achieve this goal.