I am trying to make an application in which I use the simple while loop in PHP file to show the record. the code in product.php is here: How to use this in javascript. I need to call the in the java file in the same way.
    $sql2 = "SELECT * FROM product";
        $result2 = $DBcon->query($sql2);
            if ($result2->num_rows > 0) {
                // output data of each row
                while($row2 = $result2->fetch_assoc()) {
                    $pname = $row2["product_name"];
                    $timg = $row2["thumb_img"];
                    $pimg = $row2["product_img"];
                    if(!empty($timg)){
                      echo '<img src="adminpanel/upload/product/'.$timg.'" alt="'.$pname.'" title="'.$pname.'">';
                    }else{
                      echo '<img src="adminpanel/upload/product/'.$pimg.'" alt="'.$pname.'" title="'.$pname.'">';
                    }                           
                }
            }
