Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorbrouche
    • CommentTimeJul 5th 2006
     
    Hi,

    Some viewers of my gallery reported me a bug when trying to post a comment. Here is the text displayed after they clicked on th "post comment" button:

    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 `EXIF_date_taken` ASC' at line 1

    SELECT id FROM `plg_chris_pictures` WHERE parent_album = ORDER BY `EXIF_date_taken` ASC

    Can anyone help me?
    • CommentAuthorbrouche
    • CommentTimeJul 5th 2006
     
    In addition, the comment may enventually appear, but still, this bug is annoying.

    Another bug: I noticed that the character ' is displayed with a before (I'm french and so are the viewers of my gallery, and this character is very common in this language)
  1.  
    I'm not sure why only some users are getting the comment error, but here's the reason:

    the WHERE section isn't complete... parent_album needs to = something before you can ORDER it. And I think you'll need to add parent_album to the SELECT if you use it in the WHERE.

    You aren't the only one to come across this problem:
    http://plogger.org/forum/comments.php?DiscussionID=736
    • CommentAuthorbrouche
    • CommentTimeJul 6th 2006
     
    Sorry again but I'm quite a newbie with MySQL/PHP. Could you be more explicit with the changes I must make?
  2.  
    I'm still learning php/mysql myself, so this is a guess. Make sure you back up your current gallery.php file before trying this:

    change line 137 in gallery.php from this:
    $sql = "SELECT id FROM `".$TABLE_PREFIX."pictures` WHERE parent_album = ".$row["parent_album"];

    to this:
    $sql = "SELECT id FROM `".$TABLE_PREFIX."pictures` WHERE parent_album = '".$row["parent_album"]."';

    This should work better. I was wrong about adding parent_album to the SELECT statement, because the table is already indexed by parent_album.
    •  
      CommentAuthorctlsmite
    • CommentTimeDec 3rd 2006
     
    Hi Y'all,

    I'm still getting an error with this:

    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_submitted` ASC' at line 1

    SELECT id FROM `plogger_pictures` WHERE parent_album = ORDER BY `date_submitted` ASC


    Any ideas why? My gallery is here: http://labrums.org/gallery/

    Thanks!