无法在网页上显示数据库中的图像

时间:2017-03-29 10:19:06

标签: php css database

我无法在数据库中显示我的网页上的完整图片 我的代码图像是goint to database

my database image     

$con=  mysqli_connect("localhost", "root", "", "project");

        if(!$con)
       {
           die('not connected');
       }
            $result=  mysqli_query($con, "SELECT addplace, stayamount, foodamount, airlinesamount, noofdays,noofnights, 
    SUM(stayamount + foodamount + airlinesamount) AS totalamount,choose
FROM adddetails GROUP BY packageid");



?>
<div class="container">
<CENTER><h2>view packages</h2>
</CENTER>  
<table class="table table-bordered">

  <th>place</th>
  <th>stay cost</th>
  <th>food cost</th>
  <th>flight cost</th>
  <th>no of days</th>
  <th>no of nights</th>
  <th>total amount</th>
  <th>image</th>


        <?php

             while($row =mysqli_fetch_array($result))

             {
                 ?>
            <tr>
                <td><?php echo $row['addplace']; ?></td>
                <td><?php echo $row['stayamount']; ?></td>
                <td><?php echo $row['foodamount'] ;?></td>
                <td><?php echo $row['airlinesamount'] ;?></td>
                <td><?php echo $row['noofdays'] ;?></td>
                <td><?php echo $row['noofnights'] ;?></td>
                <td><?php echo $row['totalamount'] ;?></td>
              <td><?php echo '<img src=data:image/jpeg;base64,'.base64_encode( $row['choose'] ).'>'; ?></td>
            </tr>
        <?php
             }
             ?>
             </table>
            </div>
  </div>

my web page

请重写我的代码,我希望我的150 * 150尺寸的图像能够安装在我的桌面上

1 个答案:

答案 0 :(得分:0)

尝试使用它。

<td><img src='".$row['choose']."'/></td>";