Php 在Mysql中更新图像
我想更新上传文件夹和数据库的图像,但问题是,我没有看到我的代码,只有更新数据时的错误脚本是我得到的,因为我把它放在上面,但它没有向我显示为什么图像没有更新的错误。求你了,如果你能帮我的话- 要更新的表格Php 在Mysql中更新图像,php,mysql,Php,Mysql,我想更新上传文件夹和数据库的图像,但问题是,我没有看到我的代码,只有更新数据时的错误脚本是我得到的,因为我把它放在上面,但它没有向我显示为什么图像没有更新的错误。求你了,如果你能帮我的话- 要更新的表格 <form action="actualizarimg.php" method="post" enctype="multipart/form-data"> <?php while($registro=$resultado->fetch_assoc()) { ?>
<form action="actualizarimg.php" method="post" enctype="multipart/form-data">
<?php while($registro=$resultado->fetch_assoc()) { ?>
<label for="nombre">Nombre</label>
<input type="text" value="<?php echo $registro['nombre']; ?>">
<img height="200px" src="./<?php echo $registro['ruta_imagen']; ?>">
<input type="text" value="<?php echo $registro['ruta_imagen'];?>"
<label for="img">Imágen</label>
<input type="file"> <p>Subir Archivo</p>
<label>Descripción</label>
<input type="text" value="<?php echo $registro['descripcion']; ?>">
<input type="submit" value="Actualizar">
</form>
<?php
include('conexion.php');
if(isset($_GET['cve_imagen'])){
$cve_imagen=$_GET['cve_imagen'];
}
if(isset($_GET['nombre'])){
$nombre=$_GET['nombre'];
}
if(isset($_GET['descripcion'])){
$descripcion=$_GET['descripcion'];
}
if(isset($_GET['ruta_imagen'])){
$ruta_imagen=$_GET['ruta_imagen'];
$sql = "UPDATE imagenes SET nombre='$nombre', descripcion='$descripcion', ruta_imagen='$ruta_imagen' WHERE cve_imagen='$cve_imagen' ";
print_r($conexion);
mysqli_query($conexion, $sql);
echo "<script type='text/javascript'>;
alert ('Los datos se actualizaron exitosamente');
window.location='eliminar.php';
</script>";
}else {
echo "<script type='text/javascript'>;
alert ('Error al actualizar los datos');
window.location='eliminar.php';
</script>";
}
$conexion->close();
?>
名义
"
伊马根
Subir Archivo
描述
首先,您使用POST方法发送表单。然后使用GET方法检查变量……其次,您没有任何代码可以对文件执行任何操作。请查看此处,以了解$\u文件中的详细信息。首先,您还没有命名任何表单字段。