Warning: Invalid argument supplied for foreach()
You should check that what you are passing to foreach
is an array by using the is_array function
If you are not sure it’s going to be an array you can always check using the following PHP example code:
if (is_array($variable)) {
foreach ($variable as $item) {
//do something
}
}
This means you have an error in your SQL too since it does not return any data to the foreach as far as I can understand. Make sure that your SQL is correct.
2
solved My Joomla site crashes with this error SQL code [closed]