WIthout being able to figure out the problem here, and what's going on, the problems may be in the query and implicit joins.
To get the last 5 links, that were added to any category, on the category page, you'd want to do:
SELECT Links.*
FROM Links, CatLinks
WHERE Links.ID = CatLinks.LinkID
AND CatLinks.CategoryID = '33'
Order by Links.ID DESC Limit 5
If you are passing in the globals, you can make the '33' $input->{category_id} You can use it in the query:
SELECT Links.*,CatLinks.*
FROM Links, CatLinks
WHERE Links.ID = CatLinks.LinkID
AND CatLinks.CategoryID = $input->{category_id}
Order by Links.ID DESC Limit 5
You don't need to do dates, since the ID field is incremented, the newest links will always have a higher ID than the older ones.
If you are doing this in the "globals" just do a standard query, and put the results into a $return_value->{Tag_Name}
The <%Tag_Name%> would be a HASH .... whatever.
You can then use the <%loop%> variable to format the return values in the template itself, simplifying the overall code greatly.
I was asked to look in on this thread, but I'm not sure why.
I read the thread 3 times, and still don't get what the problem is, and why.
PUGDOGŪ Enterprises, Inc.
FAQ:
http://LinkSQL.com/FAQ Forum:
http://LinkSQL.com/forum