
Problemas con mysql
Publicado por uriel (5 intervenciones) el 12/08/2016 04:26:05
Buenas noches, tengo este pequeño problema al intentar insertar datos en mysql
a continuacion el codigo
y aca una imagen del error

a continuacion el codigo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php include ('conexion.php'); ?>
<?php
$rutaEnservidor='imagenes';
$rutaTemporal=$_FILES['imagenes']['tmp_name'];
$nombreImagen=$_FILES['imagenes']['name'];
$rutaDestino=$rutaEnservidor."/".$nombreImagen;
move_uploaded_file($rutaTemporal,'../'.$rutaDestino);
$encabezado=$_POST['encabezado'];
$noticia=$_POST['noticia'];
$fuente=$_POST['fuente'];
$fecha=$_POST['fecha'];
$sql="INSERT INTO noticias (imagenes,encabezado,noticia,fuente,fecha)
VALUES ('".$rutaDestino."',
'".$encabezado."',
'".$noticia."',
'".$fuente."',
'".$fecha.")";
echo $sql;
$res=mysql_query($sql) or die(mysqli_error());
if ($res){
echo 'Insercion con exito';
}else{
echo 'No se pudo insertar';
}
return 1;
?>
<html>
<head>
<meta http-equiv="refresh" content="2; url=buscar.php" >
</head>
</html>
y aca una imagen del error

Valora esta pregunta


0