[ansel] Using datatree_id to reference galleries

Heath S. Hendrickson heath at outerspaceconsultants.com
Wed May 26 09:21:28 PDT 2004


Ben Chavet wrote:

>
> SELECT a1.datatree_id, c.datatree_name FROM horde_datatree c LEFT JOIN
> horde_datatree_attributes a1 ON a1.datatree_id = c.datatree_id WHERE
> c.group_uid = 'horde.shares.ansel' AND (a1.attribute_name = 'gallery' AND
> a1.attribute_value = 2822) AND a1.attribute_name = a1.attribute_name 
> ORDER BY
> c.datatree_order, c.datatree_name, c.datatree_id
>
> There was only 1 image in the gallery, not sure what was killing it.  
> The only
> difference from using datatree_name is the a1.attribute_value = 2822 
> instead of
> a1.attribute_value = 'some_gallery_name'.
>
It might have a problem with the datatype for the field.  Isn't the 
attribute_value field a varchar().  The server is probably interpreting 
that as an INT and not throwing an error back.  Try enclosing the value 
in quotes even for the number.

h


More information about the ansel mailing list