0

How to resolve this warning which is shown when I use "custom tables" plugin for Wordpress? Can anybody help me please

Warning: Invalid argument supplied for foreach() in ..\wp-content\plugins\custom-tables\pages\show_table.php on line 378

URL of this plugin http://wordpress.org/extend/plugins/custom-tables/

2
  • This error most probably occured if the table is empty. wordpress.org/support/plugin/custom-tables is the official support for the plugin. Commented Nov 7, 2012 at 6:02
  • but my table is not empty no help given on this official support Commented Nov 7, 2012 at 6:24

1 Answer 1

1

The Invalid argument supplied for foreach() is obtained when the element pased in the foreach() is not an array. For this plugin, at line 378:

foreach ($qry as $row) { 

You can test if it is an array before passing through the foreach loop:

if ( is_array($qry )) { foreach ($qry as $row) {...} } else die('not an array'); 

However, I encourage you to ask from the plugin support forum. The author can fix the plugin (assuming it's a problem with the plugin itself). Modifying the core of a plugin yourself is not advisable and consequently updating that plugin will overwrite your changes.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.