I have a problem recovering the path of an image in my database, the image is uploaded correctly, the route is captured well, only that the word Array comes out first, and I do not have idea because, I need you not to say that in order to use the url afterwards and show the image.
This is how it is sent to my database:
This is the code that uploads the image to the server:
subir.php
<?php
$type=$_FILES['img_up']['type'];
$tmp_name = $_FILES['img_up']["tmp_name"];
$name = $_FILES['img_up']["name"];
$nuevo_path="images/".$name;
move_uploaded_file($tmp_name,$nuevo_path);
$array=explode('.',$nuevo_path);
$ext= end($array);
echo "<h3>La imagen se subio correctamente</h3>";
?>
And in another php I recover the route:
$imagen=$_POST.$nuevo_path;
$insertar="INSERT INTO events VALUES('$id', '$fecha', '$ciudad', '$estado', '$info', '$costo', '$imagen')";
Note: omit the other variables because there is no problem in them, only with the variable $ image.
I'm not an expert, it's a school work, but I've been trying for several hours and it does not recover well, I know there are many examples on the internet but none of them help me to base myself.