如何在自定义视图中从数据库中获取图像?

I created a database and a table in that called 'Recipe', and I manually added contents to that table. It contain an image column also.

I wanted to display the table and pass it through JSON. I don't know how to display image.

My code is:

<?php

include("connection.php");

$query = "SELECT * FROM Recipe";

if ($result=mysqli_query($link, $query)) {
    $number = mysqli_num_rows($result);
    echo "<table cellpadding=\'0' cellspacing='0' class='db-table'><tr>
    <th>Recipe name</th>
    <th>Photo</th>
    <th>Steps</th>
    </tr>";
    while($recipe=mysqli_fetch_assoc($result)){
        echo "<tr>";
        echo "<td>".$recipe['Recipe_name']."</td>";
        echo "<td><img src='".getImage.php?id=1."' width='175' height='200'</td>" ;

        echo "<td>".$recipe['Recipe_steps']."</td>";
        echo "</tr>";
    }

    echo "</table>";
} else {

    echo "It failed";
}


 ?>

This line is wrong. You forgot to put the image url here. echo "" ;

You aren't referencing your image URL

echo "<td><img src='".$recipe['imageurl']."' width='175' height='200'></td>";

the image tag was not closed properly.

try to change, your missed, to put the image url here.

<img src='".getImage.php?id=1."' width='175' height='200'

to

<img src='".$recipe['imageurl']."' width='175' height='200'>