Member
Member
BertSimons   2008-01-19, 12:44
#1

using printLatestComments() I get this error:

'
Zenphoto Error
MySQL Query ( SELECT c.id, c.name, c.website, c.date, c.comment, i.title, i.filename, a.folder, a.title AS albumtitle, FROM zp_comments AS c, zp_images AS i, zp_albums AS a WHERE type=images AND c.imageid = i.id AND i.albumid = a.id ORDER BY c.id DESC LIMIT 5 ) Failed. Error: You have an error in your SQL syntax near 'FROM zp_comments AS c, zp_images AS i, zp_albums AS a WHERE type=images' at line 1
,

however with using a query like:
' $comments = query_full_array("SELECT c.id, i.title, i.filename, a.folder, a.title AS albumtitle, c.name, c.website,"
. " (c.date + 0) AS date, c.comment, c.email, c.inmoderation FROM ".prefix('comments')." AS c, ".prefix('images')." AS i, ".prefix('albums')." AS a "
. " WHERE c.imageid = i.id AND i.albumid = a.id ORDER BY c.id DESC LIMIT 20" );'

I am able to retriev the commnets. I am using the nightlybuild 18 december..
any ideas?

Member
Member
sbillard   2008-01-19, 20:57
#2

Have you run setup.php with this version? The type field was added to the database when comments for albums was implemented.

It is also possible that images needs to be enclosed in quotes.

Member
Member
BertSimons   2008-01-21, 12:35
#3

yes I ran setup. checked the database table and in zp_comments there is a field named type.

However phpmyadmin showed a warning on the table:

"Warning More than one INDEX key was created for column imageid"

indexes showed up til 19 keys: imageid imageid_1....imageid_19

I just deleted all extra keys but no change on the error..

and if I use the function: ''

the error now is:

MySQL Query ( SELECT c.id, c.name, c.website, c.date, c.comment, a.folder, a.title AS albumtitle, FROM zp_comments AS c, zp_albums AS a WHERE type=albums AND c.imageid = a.id ORDER BY c.id DESC LIMIT 1 ) Failed. Error: You have an error in your SQL syntax near 'FROM zp_comments AS c, zp_albums AS a WHERE type=albums AND c.imageid = a' at line 1

Administrator
Administrator
acrylian   2008-01-21, 13:38
#4

There is indeed a error in printlatestcomment(). We are working on it.

Administrator
Administrator
acrylian   2008-01-22, 10:10
#5

FYI: The printLatestComments function is fixed in the svn.

Member
Member
BertSimons   2008-01-22, 13:26
#6

thanks!!

Administrator
Administrator
acrylian   2008-01-22, 13:41
#7

I forgot to mention that there is no longer an option to choose between images and albums comments, it prints just all latest comments from both. But now you can set the text length to shorten the comment...
If you really need an image/album option let us know.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.