Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the easy-digital-downloads domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/danigirol0/www/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/danigirol0/www/wp-includes/functions.php on line 6114
SCRIPT para leer un Archivo CSV online - Dani Girol

SCRIPT para leer un Archivo CSV online

<?php
$mysqli = new mysqli("localhost", "", "", "");

/* verificar la conexión */
if (mysqli_connect_errno()) {
    printf("Falló la conexión failed: %s\n", $mysqli->connect_error);
    exit();
}

$linea = 0;
//Abrimos nuestro archivo
$archivo = fopen("4.csv", "r");
//Lo recorremos

//echo 'Dani';
while (($datos = fgetcsv($archivo, ";")) == true)
{
  $num = count($datos);
	
	$total=explode(';',$datos[0]);

	//print_r($total);
	
	echo $total[0];
    echo '<br>';
    echo $total[1];
    echo '<br>';
    echo $total[2];
    echo '<br>';
       
    
    
    $query = "SELECT * FROM ";
$result = $mysqli->query($query);


  //  echo $query;

/* array numérico */

while($row = $result->fetch_array()){
 
if($row['name']==$total[2]){    
    //print_r($row);
 
    echo $row['id_product_attribute'];
    
	//print_r($row);
    echo '<br>';
    
 // ps_product_attribute ean13
     echo "UPDATE ps_product_attribute
SET ean13 = '".$total[0]."'
WHERE id_product_attribute='".$row['id_product_attribute']."'"; 
    
   $sql="UPDATE ps_product_attribute
SET ean13 = '".$total[0]."'
WHERE id_product_attribute='".$row['id_product_attribute']."'";
    
    $result22222 = $mysqli->query($sql);
    
//echo $row['id_product_attribute'];
   // echo '<br>';
    

    echo $row['name'];
	
	
}
};
    
    
    
	
  //Recorremos las columnas de esa linea
 for ($columna = 0; $columna < $num; $columna++)
      {
         //echo $datos[$columna] . "\n";
     }

echo '<hr>';
    $result->free();
}
//Cerramos el archivo
fclose($archivo);






/* liberar la serie de resultados */
$result->free();

/* cerrar la conexión */
$mysqli->close();
?>