Is this a good way to insert images into the database? [duplicate]

0

form

<form action="processa" method="post" enctype="multipart/form-data">
<input type="file" name="file"/><br/>
<input type="submit" value="enviar"/>

insertion file

$ sql="INSERT INTO tb_imgbd (img) VALUES ('$ file')"; $ reg = mysqli_query ($ connection, $ sql);  header ("location: display.php");

displays the images

$ sql="SELECT * FROM tb_imgbd"; $ reg = mysqli_query ($ connection, $ sql);

while ($ log = mysqli_fetch_array ($ reg)) {     $ photo="img /".$ record ['img'];     echo $ photo;     $ separator="img /";     echo ""; }

    
asked by anonymous 15.07.2018 / 02:01

0 answers