Good to everyone as they are ..! Well my question is: can you upload an image to MySQL without having to make a form?
What I want to do is that I automatically upload the images that are in a folder to the database, because I'm really doing an application where I capture the computer screen and I want to take the screenshots and be able to see those photos in another team, but I want you to save the capture in mysql or find a way that the other team can see them.
This is the little code I have but only saves the route.
<?php
$i=0;
while ($i<5) {
require ('config.php');
$i++;
$Nombre = "Reporte".$i;
$guardado = "../img/".$Nombre.".jpeg";
$img = imagegrabscreen();
$destino_1 = imagejpeg($img,$guardado);
$conexion = mysqli_connect($db_host,$db_user,$db_pass);
if (mysqli_connect_errno()) {
echo "Fallo al conectar con la Base de Datos.";
exit();
}
mysqli_select_db($conexion, $db_bd) or die ("No se encontro la Base de Datos");
mysqli_set_charset($conexion, "utf8");
$guardar= "INSERT INTO img (ID, Nombre, Lugar) VALUES (0, '$Nombre', '$guardado') ";
$resultado=mysqli_query($conexion,$guardar);
mysqli_close($conexion);
sleep(15);
}
?>