Waqas Farooqi
Waqas Farooqi

Reputation: 65

Wordpress Custom tables plugin

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/

Upvotes: 0

Views: 181

Answers (1)

RRikesh
RRikesh

Reputation: 14411

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.

Upvotes: 1

Related Questions