After upgrading to the latest version and logging on as an admin, when I wish to get detail of the image ratings under "Administrator Home-Photos-Rating" I receive the following return instead of the rating analysis:
Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY date DESC' at line 4
SELECT *
FROM xof_rate AS r
WHERE r.element_id=
ORDER BY date DESC; in /home/dpcsanet/public_html/CMS/include/dblayer/functions_mysqli.inc.php on line 834
Notice: Trying to get property of non-object in /home/dpcsanet/public_html/CMS/include/dblayer/functions_mysqli.inc.php on line 171
Fatal error: Call to a member function fetch_assoc() on a non-object in /home/dpcsanet/public_html/CMS/include/dblayer/functions_mysqli.inc.php on line 181
How can I fix this?
First Hello?
Then you should try to reupload all files of Piwigo by overwriting existing files, first.
Offline
Hi flop25
Ho rude of me! Thank you for offering a solution - I have reuploaded all the Piwigo files and the request for "Ratings" still return the same reply. Anything else I can try?
Regards
B
Ok then the next step is to check third party extension: disable plugins
did you have ratings before? check the xof_rate table, in your database
Offline
Hi flop25
No changes after I disabled all plugins. Used to have ratings before - it disappeared after the last upgrade.
Just for clarification - the rating I am referring to is the query capability in the Administrators section, once logged on as administrator.
I am not sure where to find the db you are referring to.
Kind regards
B
Another thing - it seems that xof_rate must be contained in /functions_mysq1i.inc.php - but after I downloaded and reinstalled 2.5.3 it is not there. Does this help?
Regards
B
Hi
Any other potential solutions?
Regards
Bert
If that's not a corrupted file or a bad extensions, I'm short of solutions...
Offline
Bertus Laufs wrote:
Hi
Any other potential solutions?
Regards
Bert
can you install the plugin rv db integrity and have a run from the Tools / Maintenance page in the admin ?
I have a feeling that your db is not ok ... Did you manually (using sql or phpmyadmin ...) played with the database ?
Offline
Hi rvelices
Thank you for your response.
This started when I upgraded to 2.5.3 - and the problem is in the database, as stipulated above. I downloaded piwigo from the website and re-installed, but found the same error. I tried your solution which confirms that the problem is in the database:
DB Integrity Check
Test Result
#xof_images.id (7 references) 1 FAILED
1 error references; #xof_rate.element_id referring to #xof_images.id
#xof_categories.id (7 references) Passed
#xof_tags.id (1 references) Passed
#xof_groups.id (2 references) Passed
Pemalinks (1 references) Passed
#images(id,storage_category_id) dans #image_category (1 references) Passed
I am not sure how to fix this.
Thank you for the support
Bertus
- backup your database (just in case)
- launch the following query
DELETE FROM xof_rate WHERE element_id NOT IN (SELECT id FROM xof_images)
Offline
Hi rvelices
I am stumped!
Please explain the workflow to launch the code you suggested.
Kindest regards
Bertus
PS. I am rather stupid here, am I not? :-D
in your databse manager/interface, usually phpMyAdmin, use tab Export and the tab Execute Sql
Offline