2013-12-13 140 views
-2
<?php 
do { 
printf("<section class='sarcina'> 
<h1> 
<a href='firma.php?id=%s'>%s</a> 
</h1> 
<div id='image'> <src img='%s' width='100' height='100'> 

<div id='descriere'> 
    <h2>%s lei</h2> 
</div> 
</div> 
</section>", $pageres["id_sarcini"], $pageres["Den_Comp"],$pageres["foto"], $pageres["suma_ut"]) ; 
} 
while($pageres=mysql_fetch_array($res)); 
?> 

在这里我显示所有我需要的数据,所有的作品,但我不能显示图片。我怎样才能在这个代码中做到这一点?如何在php中显示来自mysql数据库的图像?

+0

你存储图像数据的数据库,或者图像的只是位置?生成的HTML是什么样的? –

+0

使用[验证器](http://validator.w3.org/) – Quentin

+1

首先,切换img和src在''然后发布任何错误消息你正在得到。 – Dan

回答

1

试试这个,

<img src='your image url here' width='100' height='100'> 

,而不是

<src img='%s' width='100' height='100'> 
相关问题