Page 1 of 1

categories error

Posted: 01 Jul 2009, 13:46
by wutangrob
Hi guys,
can you help to solve this problem?

frontend

Warning: Invalid argument supplied for foreach() in /home/mhd-01/www.insiemeconlamusica.net/htdocs/prova ... gories.php on line 137



backend

Warning: Invalid argument supplied for foreach() in /home/mhd-01/www.insiemeconlamusica.net/htdocs/prova ... lerycs.php on line 100


If I try to create a new category

error saving...etc

Thanks in advance

wutangrob

Re: categories error

Posted: 01 Jul 2009, 20:02
by toneddu2000
I've the same problems. With PhocaGallery 2.5.0 when I create a category it returns this error:

Warning: Invalid argument supplied for foreach() in xxx/administrator/components/com_phocagallery/models/phocagallerycs.php on line 100

instead with 2.2.4 version it gave me an another error:

Warning: Invalid argument supplied for foreach() in xxx/administrator/components/com_phocagallery/helpers/phocagallery.php on line 1199

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in xxx/libraries/joomla/database/database/mysql.php on line 344

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in xxx/libraries/joomla/database/database/mysql.php on line 344

the curious thing is that in local site 2.2.4 version works flawless! :shock:

Any help would be appreciate!Thanks! :)

Re: categories error

Posted: 01 Jul 2009, 21:22
by toneddu2000
ok, solved. Today I ran to finish a site and I didn't see this helpful link https://www.phoca.cz/documents/2-phoca-g ... em-solving. If there are lazy people who don't want to copy and paste from install.bak and change table name file I've made a file with all the tables needed! :D

If you have left default name for database ( jos_ )(and only if you did it), go in your phpmyadmin ,then in SQL tab,and in the blank space just copy every table piece of code that goes from "CREATE TABLE" until "CHARSET=utf8;" do this for all six tables

Code: Select all

CREATE TABLE `jos_phocagallery` (

  `id` int(11) unsigned NOT NULL auto_increment,

  `catid` int(11) NOT NULL default '0',

  `sid` int(11) NOT NULL default '0',

  `title` varchar(250) NOT NULL default '',

  `alias` varchar(255) NOT NULL default '',

  `filename` varchar(250) NOT NULL default '',

  `description` text NOT NULL default '',

  `date` datetime NOT NULL default '0000-00-00 00:00:00',

  `hits` int(11) NOT NULL default '0',

  `published` tinyint(1) NOT NULL default '0',

  `checked_out` int(11) NOT NULL default '0',

  `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',

  `ordering` int(11) NOT NULL default '0',

  `params` text NOT NULL,

  `extlink1` text NOT NULL,

  `extlink2` text NOT NULL,

  PRIMARY KEY  (`id`),

  KEY `catid` (`catid`,`published`)

) TYPE=MyISAM CHARACTER SET `utf8`;






CREATE TABLE `jos_phocagallery_categories` (

  `id` int(11) NOT NULL auto_increment,

  `parent_id` int(11) NOT NULL default 0,

  `title` varchar(255) NOT NULL default '',

  `name` varchar(255) NOT NULL default '',

  `alias` varchar(255) NOT NULL default '',

  `image` varchar(255) NOT NULL default '',

  `section` varchar(50) NOT NULL default '',

  `image_position` varchar(30) NOT NULL default '',

  `description` text NOT NULL,

  `date` datetime NOT NULL default '0000-00-00 00:00:00',

  `published` tinyint(1) NOT NULL default '0',

  `checked_out` int(11) unsigned NOT NULL default '0',

  `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',

  `editor` varchar(50) default NULL,

  `ordering` int(11) NOT NULL default '0',

  `access` tinyint(3) unsigned NOT NULL default '0',

  `hits` int(11) NOT NULL default '0',

  `count` int(11) NOT NULL default '0',

  `params` text NOT NULL,

  PRIMARY KEY  (`id`),

  KEY `cat_idx` (`section`,`published`,`access`),

  KEY `idx_access` (`access`),

  KEY `idx_checkout` (`checked_out`)

) TYPE=MyISAM CHARACTER SET `utf8`;





CREATE TABLE `jos_phocagallery_votes` (

  `id` int(11) NOT NULL auto_increment,

  `catid` int(11) NOT NULL default 0,

  `userid` int(11) NOT NULL default 0,

  `date` datetime NOT NULL default '0000-00-00 00:00:00',

  `rating` tinyint(1) NOT NULL default '0',

  `published` tinyint(1) NOT NULL default '0',

  `checked_out` int(11) unsigned NOT NULL default '0',

  `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',

  `ordering` int(11) NOT NULL default '0',

  `params` text NOT NULL,

  PRIMARY KEY  (`id`)

) TYPE=MyISAM DEFAULT CHARSET=utf8;





CREATE TABLE `jos_phocagallery_comments` (

  `id` int(11) NOT NULL auto_increment,

  `catid` int(11) NOT NULL default 0,

  `userid` int(11) NOT NULL default 0,

  `date` datetime NOT NULL default '0000-00-00 00:00:00',

  `title` varchar(255) NOT NULL default '',

  `comment` text NOT NULL,

  `published` tinyint(1) NOT NULL default '0',

  `checked_out` int(11) unsigned NOT NULL default '0',

  `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00',

  `ordering` int(11) NOT NULL default '0',

  `params` text NOT NULL,

  PRIMARY KEY  (`id`)

) TYPE=MyISAM DEFAULT CHARSET=utf8;




CREATE TABLE `jos_phocagallery_votes_statistics` (

  `id` int(11) NOT NULL auto_increment,

  `catid` int(11) NOT NULL default 0,

  `count` tinyint(11) NOT NULL default '0',

  `average` float(8,6) NOT NULL default '0',

  PRIMARY KEY  (`id`)

) TYPE=MyISAM DEFAULT CHARSET=utf8;




CREATE TABLE `jos_phocagallery_user_category` (

  `id` int(11) NOT NULL auto_increment,

  `catid` int(11) NOT NULL default 0,

  `userid` int(11) NOT NULL default 0,

  PRIMARY KEY  (`id`),

  KEY `catid` (`catid`,`userid`)

) TYPE=MyISAM DEFAULT CHARSET=utf8;
I hope this could be helpful! :wink:

Re: categories error

Posted: 02 Jul 2009, 02:22
by coolstone
THANKS SO MUCH!

It works for me! :twisted: :twisted: :twisted: :twisted: :twisted:

Re: categories error

Posted: 02 Jul 2009, 16:39
by toneddu2000
I'm glad that it was helpful :D