Page 1 of 1

Don't know how to fix table problem

Posted: 26 Mar 2011, 06:49
by mcmunchly
I just installed the lastet version of Phoca Gallery for joomla 1.6

whenever I try to look at my images or components I get this error:

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

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

I looked up the error and Phoca's documentation says that some tables were not installed and I have to do it manaually but looking in my database through phpMyAdmin and doing some stuff.

I don't know how to look in my database and have no clue what phpMyAdmin is.

Can I get a step-by-step "how to" for getting the tables fixed?

Sorry if this is a duplicate thread. I tried posting earlier but I can't find the thread so Ithough something didn't go through.

Re: Don't know how to fix table problem

Posted: 27 Mar 2011, 16:14
by Benno
Hi,
1. Try to install Phoca Gallery once more. (Sometimes it works, and it's the most easy way to solve your problem.)

2. if not:
I don't know how to look in my database and have no clue what phpMyAdmin is.
phpMyAdmin is a program to edit a MySQL database. You need this, or a program like this, to install the missing database tables manually. So contact your hosting company and ask how you get access to it.
When you have access to phpMyAdmin and your database, you should see this Phoca Gallery tables:
jos_phocagallery
jos_phocagallery_categories
jos_phocagallery_comments
jos_phocagallery_fb_users
jos_phocagallery_img_comments
jos_phocagallery_img_votes
jos_phocagallery_img_votes_statistics
jos_phocagallery_user
jos_phocagallery_votes
jos_phocagallery_votes_statistics

3. If tables are missing, make a complet database backup with help of phpMyAdmin before you change anything!!
All you need to create the tables for Phoca Gallery 3.0.0 RC4 manually, you will find in the file install.bak.sql in the com_phocagallery_v3.0.0_rc4.zip package.
For example, if the table jos_phocagallery_categories is missing copy and paste following code in the Run SQL query/queries window of phpMyAdmin and press the Go button:

Code: Select all

CREATE TABLE `jos_phocagallery_categories` (
  `id` int(11) NOT NULL auto_increment,
  `parent_id` int(11) NOT NULL Default 0,
  `owner_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,
  `date` datetime NOT NULL Default '0000-00-00 00:00:00',
  `published` tinyint(1) NOT NULL Default '0',
  `approved` 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',
  `accessuserid` text,
  `uploaduserid` text,
  `deleteuserid` text,
  `userfolder` text,
  `latitude` varchar(20) NOT NULL Default '',
  `longitude` varchar(20) NOT NULL Default '',
  `zoom` int(3) NOT NULL Default '0',
  `geotitle` varchar(255) NOT NULL Default '',
  `params` text,
  `metakey` text,
  `metadesc` text,
  `metadata` text,
  `extid` varchar(255) NOT NULL Default '',
  `exta` varchar(255) NOT NULL Default '',
  `extu` varchar(255) NOT NULL Default '',
  `extauth` varchar(255) NOT NULL Default '',
  `extfbuid` int(11) NOT NULL Default '0' '',
  `extfbcatid` varchar(255) NOT NULL Default '',
  `language` char(7) NOT NULL Default '',
  PRIMARY KEY  (`id`),
  KEY `cat_idx` (`section`,`published`,`access`),
  KEY `idx_access` (`access`),
  KEY `idx_checkout` (`checked_out`)
) ENGINE=MyISAM CHARACTER SET `utf8`;
Hope this helps.
Kind regards,
Benno

Re: Don't know how to fix table problem

Posted: 30 Mar 2011, 00:00
by rolmar
I changed all Phoca Gallery table Collation values from utf8_general_ci to utf8_unicode_ci.
It fixed the error.

Re: Don't know how to fix table problem

Posted: 30 Mar 2011, 23:43
by fawkes
Hi,
I just installed phoca gallery, and first off I really have to say a big thanks to the guys working on it; from my first impressions I must say it's really excellent!
During install, however, I also had the problem that the tables weren't created automatically.
Since this seems to be a problem for many users (at least from what a quick google search, and the explicit mention in the install FAQ tells me), I ask myself under which condition the automatic installation of the tables will indeed work currently?
Maybe only if there's a previous installation of Phoca gallery?
Just looking for a way to maybe improve this otherwise awesome component...

Re: Don't know how to fix table problem

Posted: 07 Apr 2011, 12:28
by Jan
Hi, really no idea there, testing on many environments, still didn't find why on some server the tables are not written :-(

Mostly there is problem with obsolete database, some limit settings, or security settings, etc.

Jan

Re: Don't know how to fix table problem

Posted: 09 Jun 2011, 07:25
by mcmunchly
Hi. It's been awhile but I didn't get around to looking at the problem until now.

I am still getting that same error message even though the tables ARE there. Now I'm completely stumped. I tried reinstalling with the newest version but no dice.