问题
So my joomla site crashes throwing me this error , the weird thing is that the other guy being on my site at the sametime in another state still has my site working for him ok ... It crashes when I try to save info to post in the database .. Below is the error, i WOULD appreciate and be forever grateful for any tip to fix this ! Thanks !! By the way , I was browsing it from the starbucks and everyone's using wifi ...
Error loading module MySQL server has gone away SQL=SELECT m.id, m.title, m.module, m.position, m.content, m.showtitle, m.params, mm.menuid FROM pwo3d_modules AS m LEFT JOIN pwo3d_modules_menu AS mm ON mm.moduleid = m.id LEFT JOIN pwo3d_extensions AS e ON e.element = m.module AND e.client_id = m.client_id WHERE m.published = 1 AND e.enabled = 1 AND (m.publish_up = '0000-00-00 00:00:00' OR m.publish_up <= '2013-01-22 04:58:42') AND (m.publish_down = '0000-00-00 00:00:00' OR m.publish_down >= '2013-01-22 04:58:42') AND m.access IN (1,1,2,3) AND m.client_id = 0 AND (mm.menuid = 207 OR mm.menuid <= 0) ORDER BY m.position, m.ordering
Warning: Invalid argument supplied for foreach() in /home/content/72/9959172/html/libraries/joomla/database/database/mysql.php on line 383
Warning: Invalid argument supplied for foreach() in /home/content/72/9959172/html/libraries/joomla/database/database/mysql.php on line 383
Warning: Invalid argument supplied for foreach() in /home/content/72/9959172/html/libraries/joomla/database/table.php on line 406
An error has occurred.
The requested page cannot be found.
Home Page
If difficulties persist, please contact the System Administrator of this site and report the error below.
回答1:
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.
来源:https://stackoverflow.com/questions/14451959/my-joomla-site-crashes-with-this-error-sql-code