Good evening.
I would like to count on your help in solving a problem that has been grinding my molecule for a few days and I still can not find a solution.
I have the following code to send to the 4-photo server:
if(isset($_POST['submit']))
{
$selectmaxpro=mysql_fetch_array(mysql_query("select max('imp_id') as 'impid' from 'imp'"));
$maxidpro=$selectmaxpro['impid']+1;
$path = "imo/uploads/";
$count = 0;
foreach ($_FILES['files']['name'] as $f => $name) {
mysql_query("insert into 'images_imp' values('','$name','$maxidpro')");
if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $path.$name)) {
$count++;
}
}
So far so good ... my problem is that in the database the elements are all followed assuming the same id. How to display the image:
WhatquerystringdoIhavetodosothatarrayvaluesarewrittentodifferentcolumnstype:
Ifitisnotpossible,howcanIaccessorselecteachoftheimagesinisolationforpresentationonthepage?ThecodeIhavejustallowsmetodisplaythefirstoftheimageswiththesameid...
<div id="imagem1">
<?php
$selectphoto=mysql_fetch_array(mysql_query("select * from 'images_imp' where 'imp_id'='$id' "));
?>
<img id="targetLayer" src="imo/uploads/<?php echo $selectphoto['imag']; ?>" alt="Image">
</div>