PDA


View Full Version : Warning: Invalid argument supplied for foreach() Errors


Goatpod
11-09-2005, 10:49 AM
Hi,

I've installed VB Advanced - everything seems to work fine apart from these error messages received in my admincp pages:

Warning: Invalid argument supplied for foreach() in /admincp/vba_cmps_admin.php on line XXXX

They appear on:

Default Settings (When showing modules)
Edit Pages
Quick Permissions page

I've tried some of the solutions relating to this type of error elsewhere on the forum but the errors still there. I've checked paths and reloaded pages. I haven't done a complete re-install though.

Probably just me being dumb - I'm still a bit wet behind the ears when it comes to PHP etc. :rolleyes:

Thanks in advance for any help that can be offered.

Brian
11-09-2005, 01:32 PM
Looks like you've accidentally parented your homepage to itself. Try running this query and see if it takes care of the problem:

UPDATE adv_pages SET parentid = 0 WHERE pageid = 1

Goatpod
11-09-2005, 06:36 PM
Thanks, Brian,

At the risk of sounding like a complete thickie, where do I run this query? :)

Dave

Brian
11-10-2005, 12:58 PM
Either through phpMyAdmin, or you can do it through your vB admin cp if you have your userid entered in the $config['SpecialUsers']['canrunqueries'] setting in your config.php file.

Goatpod
11-10-2005, 01:24 PM
Hi Brian,

Many thanks, I thought I may have to run it through the admin CP but it was coming back with errors. Then it dawned on me there's a prefix on all my tables! Added that, everything's fine now :)

Thanks again for the help, it's very much appreciated.

nexus851
11-12-2005, 08:08 AM
im also getting all these "Warning: Invalid argument supplied for foreach() in /admincp/vba_cmps_admin.php on line XXXX" errors...i tried to run the query and it says

"An error occurred while attempting to execute your query. The following information was returned.
error number: 1146
error desc: Table 'pimpwith_vb.adv_pages' doesn't exist"

Please help and advise...

Brian
11-12-2005, 01:03 PM
Do you use table prefixes? If so, add the prefix before 'adv_pages' in the query.

nexus851
11-12-2005, 06:07 PM
I'm sorry, but im a total newbie at this... what's table prefix? and how do i add "adv_pages" in the query?

Brian
11-13-2005, 11:17 AM
Open your includes/config.php file and look for this line:

$config['Database']['tableprefix'] = '';

If you have something entered between the '' marks, then that is your table prefix. So if you have (for example) 'vB3_' entered, you would need to change that query to this:

UPDATE vB3_adv_pages SET parentid = 0 WHERE pageid = 1