Yeah I was just wondering what may have caused this. I downloaded all my files from my webhoster into a new folder so I could debug an error I was getting - thing is, the script works fine on my computer (localhost) - so I’m guessing it must be a server configuration problem?
This is the error:
Warning: Invalid argument supplied for foreach() in /home/~usr/public_html/site.com/administrator/includes/hosts/edit_misc.php on line 17
Warning: Invalid argument supplied for foreach() in /home/~usr/public_html/site.com/administrator/includes/functions.php on line 834
Now line 17 of the first file is:
foreach($billing_cycle as $billing){
echo insert_misc_options($host_id, $billing_table, $billing_field, $billing);
}
delete_misc_options($host_id, $billing_table, $billing_field, $billing_cycle);
And the function producing the second error is:
function delete_misc_options($host_id, $table, $field, $opt) {
global $db;
$query = "DELETE ";
$query .= "FROM $table ";
$query .= "WHERE ";
line 834 —> foreach($opt as $option) {
$query .= " $table.$field NOT LIKE $option";
$query .= " AND ";
}
$query .= "$table.host_id = $host_id";
$result = mysql_query($query, $db);
confirm_query($result);
}
And as I said - it works fine offline so I'm a little confused :confused:
Hosting PHP version: 5.2.9
Hosting MYSQL Version: 5
Hosting Apache: 2.2
My PHP Version: 5.2.13
My MYSQL: 5
My Apache 2.2
All the data and tables in the databases are the exact same, and none of the arrays being passed through the foreach are empty (which would understandably break the code) but as I said - files, database etc. exactly the same both on and offline.
Any help appreciated!