问题描述:

I can insert my image in database but i dont find a way to get it.The image was inserted through the website.

My php code:

require_once('something.php');

$codservico=$_GET['id'];

$consulta="select * from xxxxx where xxxxx=".$something;

$resultado=mysql_query($consulta);

$nregistos=mysql_num_rows($resultado);

if($nregistos>0)

{

for ($i=0; $i<$nregistos; $i++){

$registo=mysql_fetch_array($resultado);

echo '<tr class="show">';

echo '<td class="show"><img src="data:image;base64,'.$registo['image'].'"></td>';

echo '</tr>';

}

}

else

{

echo "<td colspan='8' align='middle'>Nenhum registo encontrado</td>";

}

And i get something like this:

http://costumerbook.netai.net/Capturar.PNG

网友答案:

You'll need to specify the Content-Type (image format) - data:image/png;base64:

echo '<td class="show"><img src="data:image/png;base64,'.$registo['image'].'"></td>';
相关阅读:
Top