Cuando lo subo al servidor que tenemos contratado en la web, el problema que me apace es este:
Unknown column 'imagen_ruta' in 'field list'
os dejo el codigo
Código PHP:
$consult="select MAX(id)from BESTPRACTICES";
$result=mysql_query($consult) or die(mysql_error());
$row=mysql_fetch_row($result) or die (mysql_error());
$id=$row[0]+1;
echo $id;
//datos del fichero
$archivo=$_FILES['archivo']['tmp_name'];
$imagen_tamano=$_FILES['archivo']['size'];
$imagen_nombre=$_FILES['archivo']['name'];
$imagen_tipo=$_FILES['archivo']['type'];
$imagen_titulo=$_POST['imagen_titulo'];
if (!$archivo)
{
$imagen_ruta=NULL;
$imagen_tamano=0;
$imagen_nombre=NULL;
$imagen_tipo=NULL;
$imagen_titulo=NULL;
}
else
{
echo "Entra en else";
$imagen_ruta="imagin_bestpractices"."/".$imagen_nombre;
move_uploaded_file($archivo,$imagen_ruta);
}
$registro="INSERT INTO BESTPRACTICES
(id, name,territorio,institution,bestpractice,comments,timeduration,documentation,web,contacts,imagen_ruta,imagen_titulo,imagen_tipo,imagen_nombre) VALUES
('$id','$f1','$f2','$f3','$f4','$f5','$f6','$f7','$f8','$f9','','','','')";
if (!mysql_query($registro)){
die ("<br> Error no se ha insertado el registro:" .mysql_error());
}
else
{ echo "Record added";
echo "<a href='formularioBestPractices_en.php'> Return </a>";
//header("location:formularioBestPractices_en.php");
}
include ("disconnect.php");
?>