hi everyone
ive had the script working before, no idea why its not working now
<?php
$url = "url feed"; // insert your download url for a gzipped, csv file
$filename = "xxxxxxx"; // the name you want for the saved gzipped file
$newfilename = "xxxxxxx"; //change this to whatever filename you want
echo "$url<br>";
echo "$filename";
echo "<br>$newfilename<br>";
echo "Burrrrr00000!";
?>
<?php
// maximum execution time in seconds 0=unlimited
set_time_limit(0);
//set memory limit
ini_set("memory_limit","3072M");
$newfname = $filename;
$file = fopen ($url, "rb");
if ($file) {
$newf = fopen ($newfname, "wb");
if ($newf)
while(!feof($file)) {
fwrite($newf, fread($file, 1024 ), 1024 );
}
}
if ($file) {
fclose($file);
}
if ($newf) {
fclose($newf);
}
$zd = gzopen($filename, "r");
$contents = gzread($zd, 10000000); //because I have no idea how big your file will be
gzclose($zd);
$tempvar = fopen($newfilename,"w");
fwrite($tempvar, $contents);
fclose($tempvar);
echo "iiiiii";
?>
<?php
//Configuration
include 'config.php';
mysql_select_db($dbname);
//delete the old info
$query = "truncate TABLE product";
$result = mysql_query($query) or die (mysql_error());
echo "Burrrrr1!";
?>
<?php
$sql = 'LOAD DATA LOCAL INFILE \''. $filename .'\' INTO TABLE product FIELDS TERMINATED BY \',\' ENCLOSED BY \'"\' IGNORE 1 LINES';
$result = mysql_query($sql) or die (mysql_error());
echo "Burrrrr2";
?>
<?
mysql_close($conn);
echo "Burrrrr3!";
?>
i cant see it kicking up errors in the error log, so a bit confused
🙁