Forum Moderators: coopster
I run a site based loosely around mamboserver, and simplemachines forums. Simplemachines contains an SSI.php file with various functions- the one I want being a login box that I can put on the main mamboserver page along with the other php functions.
So basically, I go: <?php include ("bboard/SSI.php");?><?php ssi_login();?> right underneath the main menu, which causes the other functions to mess up:
Warning: Invalid argument supplied for foreach() in /home/simcitys/public_html/new_simcitysphere/classes/mambo.php on line 1640
Table \'simcitys_scsbboard.mos_content\' doesn\'t exist SQL=SELECT ROUND(v.rating_sum/v.rating_count) AS rating, v.rating_count,\na.*, u.name AS author, u.usertype\nFROM mos_content AS a\nINNER JOIN mos_content_frontpage AS f ON f.content_id = a.id\nLEFT JOIN mos_users AS u ON u.id = a.created_by\nLEFT JOIN mos_content_rating AS v ON a.id = v.content_id\nWHERE a.state=\'1\'\n AND (publish_up = \'0000-00-00 00:00:00\' OR publish_up <= NOW())\n AND (publish_down = \'0000-00-00 00:00:00\' OR publish_down >= NOW())\nORDER BY f.ordering, a.ordering ASC, a.catid, a.sectionid LIMIT 6
No items to display
When I remove <?php include ("bboard/SSI.php");?>, everything EXCEPT for the login box works :(
How can I possibly fix this without destroying one or the other?
-thanks
This error message:
Invalid argument supplied for foreach()
tells me that PHP is expecting to get an array on line 1640, but it's getting something else instead. Check that line, look at the arguments in the foreach loop, and see if any of those variables are being redefined within SSI.php.
It could be a quick painless 2-second fix, or a week of headaches and debugging. good luck.
Based on the error output, I'm guessing the problem happens fairly far upstream with a failed query? Is the array in the foreach on line 1640 based on the results returned from a query?