I'm trying to get data from a table inside MySQL then put it inside an html table. Almost all the data appears right, but the images that i stored in long blob bugs and appears codified as a lot of characters instead. Everything else in functional as intended. Inside the code foto=longblob image.
<?php
$tipo =$_GET["tipo"];
$conexao = mysqli_connect("127.0.0.1","root","","db_tcc") or die ("Não foi possível se conectar com o servidor.");
switch($tipo){
case "0":
$varsql = "SELECT * FROM tb_locaissp ORDER BY id ASC";
break;
case "1": case "2": case "3":
$varsql = "SELECT * FROM tb_locaissp WHERE TIPO='$tipo' ORDER BY id ASC";
break;
}
$carregar_guias = mysqli_query($conexao, $varsql);
while ($linha = mysqli_fetch_array($carregar_guias))
{
$id = $linha["ID"];
$img = $linha["FOTO"];
$nome = $linha["NOME"];
$desc = $linha["DESCRICAO"];
echo "<div class='loc'>
<table class='tablel'>
<tr><td class='nome'>$nome</td> <td><img class='contador' src='like' '> </td></tr>
<tr><td class='imglo'><img src='$img'></td></tr>
<tr><td class='desc'>$desc</td></tr>
</table></div>";
echo "<br><br>";
}
?>