Problem solved. It ended up being XE’s problem. apparently they don’t work on the weekends, so the feed hadn’t been activated yet. Once that was fixed and a few other things were figured out, it worked just fine. This is what i ended up with
[php]<?php
ini_set(“magic_quotes_gpc”, 0);
ini_set(‘auto_detect_line_endings’, true);
// db connection script
$file = file(‘http://url’, FILE_IGNORE_NEW_LINES); //can’t show the real url
for($i = 23; $i < count($file); $i++) {
$line = $file[$i];
$arr = explode(",", $line);
foreach($arr as $key => $value) {
$arr[$key] = $value;
}
$find = mysql_query("SELECT code FROm xe WHERE code = $arr[0]");
if(mysql_num_rows != 0) {
$build = "UPDATE xe SET usdrate = $arr[2], backrate = $arr[3] WHERE code = $arr[0]";
} else {
$build = "INSERT INTO xe (code, country, usdrate, backrate) VALUES (" . implode(", ", $arr). ")";
}
mysql_query($build);
}
?> [/php]
The feed i get has a crap load of useless lines on top, that’s why i start where i do.