Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

phpImage

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Mostrar imagenes</title>
</head>
<body>
<center>
    <table border= "2">
            <thead>
        <tr>
            <th>id</th>
            <th>Nombre</th>
            <th>Imagen</th>
            <th>Operaciones</th>
        </tr>
            </thead>
            <tbody>
                <?php
                // reemplace include ("conexion.php");
                require_once 'conexion.php';

                $query="SELECT * FROM tabla_imagen";
                //agregue este
                $conexion=new Conexion();
                //
                $resultado= $conexion->query($query);

                

                while($row = $resultado->fetch_assoc()){


                ?>
                <tr>
                    <td><?php echo $row['id']; ?> </td>
                    <td><?php echo $row['nombre']; ?> </td>
                    <td><img src="data=image/jpg;base64, <?php echo base64_encode($row['Imagen']); ?>"></td>
                    <th><a href="#">Modificar</a></th>
                    <th><a href="#">Eliminar</a></th>
                </tr>
                <?php 
                }
                ?>
            </tbody>
    </table>

</center>
</body>
</html>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #phpImage
ADD COMMENT
Topic
Name
6+5 =