#6 el código del insert es el siguiente:
if(isset($_POST['update']){
$sentencia = "UPDATE obras SET artista ='$artista',
titulo = '$titulo' , fecha = '$fecha', medidas='$medidas' , medium='$medium', procedencia='$procedencia' ,
exhibition ='$exhibition',ref_number='$refnumber' , descripcion='$descripcion',expertoname1='$expertoname1',
expertodoc1='$expertodoc1',traduccion='$traduccion',traduccion1='$traduccion1', traduccion2='$traduccion2',
expertoname2='$expertoname2',expertodoc2='$expertodoc2',traduccion_exp='$traduccion_exp',traduccion_exp1='$traduccion_exp1',
traduccion_exp2='$traduccion_exp2',bibliografia='$bibliografia',c_report='$c_report',factura='$factura',ownership='$ownership',
deposito='$deposito',pvp='$pvp',offers='$offers',marketprice='$marketprice',catalogos='$catalogos',exhibitions_publications='$exhibitions_publications',
publicidad='$publicidad',localizacion='$localizacion',caja='$caja',permiso='$permiso',licencia='$licencia',citex_file='$citex_file',
piece_tiff ='$piece_tiff', piece_tiff1 ='$piece_tiff1',
piece_tiff2 ='$piece_tiff2',piece_tiff3 ='$piece_tiff3',piece_tiff4 ='$piece_tiff4',piece_tiff5 ='$piece_tiff5',piece_jpg ='$piece_jpg',piece_jpg1 ='$piece_jpg1',
piece_jpg2 ='$piece_jpg2',piece_jpg3 ='$piece_jpg3',piece_jpg4 ='$piece_jpg4',piece_jpg5 ='$piece_jpg5',piece_comparativastiff ='$piece_comparativastiff',
piece_comparativastiff1 ='$piece_comparativastiff1',piece_comparativastiff2 ='$piece_comparativasiff2',piece_comparativastiff3 ='$piece_comparativastiff3',
piece_comparativastiff4 ='$piece_comparativastiff4',piece_comparativastiff5 ='$piece_comparativastiff5',piece_comparativasjpg ='$piece_comparativasjpg',piece_comparativasjpg1 ='$piece_comparativasjpg1',
piece_comparativasjpg2 ='$piece_comparativasjpg2',piece_comparativasjpg3 ='$piece_comparativasjpg3',piece_comparativasjpg4 ='$piece_comparativasjpg4',
piece_comparativasjpg5 ='$piece_comparativasjpg5',piece_resttiff ='$piece_resttiff',piece_resttiff1 ='$piece_resttiff1',
piece_resttiff2 ='$piece_resttiff2',piece_resttiff3 ='$piece_resttiff3',piece_resttiff4 ='$piece_resttiff4',piece_resttiff5 ='$piece_resttiff5',
piece_restjpg ='$piece_restjpg',piece_restjpg1 ='$piece_restjpg1',
piece_restjpg2 ='$piece_restjpg2',piece_restjpg3 ='$piece_restjpg3',piece_restjpg4 ='$piece_restjpg4',piece_restjpg5 ='$piece_restjpg5',
citex='$citex' WHERE id_obras='$id'";
$resultado=mysql_query($sentencia) or die('Error en:'.$sentencia.'::'. mysql_error());
echo "<br />";
echo "UPDATE :".$sentencia;
echo "<br />";
}
else
{
$sentencia = "INSERT INTO obras (artista ,titulo , fecha, medidas , medium, procedencia ,exhibition ,ref_number , descripcion,
expertoname1,expertodoc1,traduccion,traduccion1, traduccion2,expertoname2,expertodoc2,traduccion_exp,
traduccion_exp1,traduccion_exp2,bibliografia,c_report,factura,ownership,
deposito,pvp,offers,marketprice,catalogos,exhibitions_publications,publicidad,localizacion,caja,permiso,licencia,
citex_file,piece_tiff,piece_tiff1,piece_tiff2,piece_tiff3,piece_tiff4,piece_tiff5,piece_jpg,piece_jpg1,
piece_jpg2,piece_jpg3,piece_jpg4,piece_jpg5,piece_comparativastiff,piece_comparativastiff1
,piece_comparativastiff2,piece_comparativastiff3,piece_comparativastiff4,piece_comparativastiff5,piece_comparativasjpg
,piece_comparativasjpg1,piece_comparativasjpg2,piece_comparativasjpg3,piece_comparativasjpg4,piece_comparativasjpg5
,piece_resttiff,piece_resttiff1,piece_resttiff2,piece_resttiff3,piece_resttiff4,piece_resttiff5,piece_restjpg
,piece_restjpg1,piece_restjpg2,piece_restjpg3,piece_restjpg4,piece_restjpg5,citex)
VALUES ('$artista','$titulo','$fecha','$medidas','$medium','$procedencia','$exhibition','$refnumber','$descripcion',
'$expertoname1','$expertodoc1','$traduccion','$traduccion1','$traduccion2','$expertoname2','$expertodoc2',
'$traduccion_exp','$traduccion_exp1','$traduccion_exp2','$bibliografia','$c_report','$factura','$ownership',
'$deposito','$pvp','$offers','$marketprice','$catalogos','$exhibitions_publications','$publicidad','$localizacion',
'$caja','$permiso','$licencia','$citex_doc','$piece_tiff','$piece_tiff1','$piece_tiff2','$piece_tiff3','$piece_tiff4','$piece_tiff5'
,'$piece_jpg','$piece_jpg1','$piece_jpg2','$piece_jpg3','$piece_jpg4','$piece_jpg5','$piece_comparativastiff','$piece_comparativastiff1'
,'$piece_comparativastiff2','$piece_comparativastiff3','$piece_comparativastiff4','$piece_comparativastiff5','$piece_comparativasjpg'
,'$piece_comparativasjpg1','$piece_comparativasjpg2','$piece_comparativasjpg3','$piece_comparativasjpg4','$piece_comparativasjpg5'
,'$piece_resttiff','$piece_resttiff1','$piece_resttiff2','$piece_resttiff3','$piece_resttiff4','$piece_resttiff5','$piece_restjpg'
,'$piece_restjpg1','$piece_restjpg2','$piece_restjpg3','$piece_restjpg4','$piece_restjpg5','$citex')";
$resultado=mysql_query($sentencia) or die('Error en:'.$sentencia.'::'. mysql_error());
echo "INSERT :".$sentencia;
}
entiendo que sea muy sucio, tengo que mejorarlo e intentaré hacerlo en pdo cuando me funcione..
el tema es que lo inserts tipo artista,titulo me lo hace bien, a la hora de insertar una imagen (piece_*)si tengo 4 imagenes por ejemplo y añado otra se me borran esas 4 y me añade la que inserto
por que podría ser?
$piece_tiff_file = $_FILES['tiff']['name'][0];$tmp_tiff = $_FILES['tiff']['tmp_name'][0];
$piece_tiff1_file = $_FILES['tiff']['name'][1];$tmp_tiff1 = $_FILES['tiff']['tmp_name'][1];
$piece_tiff2_file = $_FILES['tiff']['name'][2];$tmp_tiff2 = $_FILES['tiff']['tmp_name'][2];
$piece_tiff3_file = $_FILES['tiff']['name'][3];$tmp_tiff3 = $_FILES['tiff']['tmp_name'][3];
$piece_tiff4_file = $_FILES['tiff']['name'][4];$tmp_tiff4 = $_FILES['tiff']['tmp_name'][4];
$piece_tiff5_file = $_FILES['tiff']['name'][5];$tmp_tiff5 = $_FILES['tiff']['tmp_name'][5];
$piece_tiff = str_replace(' ', '-', $piece_tiff_file);
$piece_tiff1 = str_replace(' ', '-', $piece_tiff1_file);
$piece_tiff2 = str_replace(' ', '-', $piece_tiff2_file);
$piece_tiff3 = str_replace(' ', '-', $piece_tiff3_file);
$piece_tiff4 = str_replace(' ', '-', $piece_tiff4_file);
$piece_tiff5 = str_replace(' ', '-', $piece_tiff5_file);