Ver Mensaje Individual
  #4 (permalink)  
Antiguo 28/02/2014, 06:30
RaulCDT
 
Fecha de Ingreso: febrero-2014
Ubicación: Murcia
Mensajes: 119
Antigüedad: 10 años, 2 meses
Puntos: 0
Respuesta: Enviado con exito

Perdón me equivoque al ponerlo en mysqli

Código PHP:
<?php     
include("conexion.php");    
$link=Conectarse();      

$LG_cmNew=$_POST['LG_cmNew'];    



$dir "carpeta"
$ext = array('image/jpeg''image/gif''image/png''image/bmp');     
    foreach(
$_FILES as $archivo) {     
        
$attachtmp  $archivo['tmp_name'];     
        
$attachtype $archivo['type'];     
        
$attachname $archivo['name'];     
        if(
file_exists($attachtmp)) {     
            if(
is_uploaded_file($attachtmp)) {     
                if(
in_array($attachtype,$ext)) {     
                    
$ruta move_uploaded_file($attachtmp"$dir/$attachname");    
                    
mysqli_query($link"INSERT INTO tabla (id, LG_cmNew, Logo_cmNew) VALUES ('','$LG_cmNew','$attachname')") or die(mysqli_error());     

echo 
"<br>Datos enviado con éxito<br>";  

}  
                } else {     
                    echo 
"Esto no es una imagen";     
                }     
            }     
        }     
    }     
?>
y el include conexion.php tengo:

Código PHP:
<?php
$link 
mysqli_connect("localhost""mi_usuario" "mi_password" "la_BD"); 
mysqli_select_db$link"la_BD" );
mysqli_close($link);
?>

O estoy haciendo algo mal?

Última edición por RaulCDT; 28/02/2014 a las 06:40