I'm running a MT installation with one main blog and 7 "feeder" blogs. The main blog displays it's entry and below that, an entry from each feeder blog with the same category.
I started using MTSQLCategories and MTSQLEntries to do the retrieval so that we could have more control over the display order of the entries.
I had the main index working perfectly and was cruising along perfecting the archive templates and I noticed that now when I "save and publish" the main index alone, it works fine. If I publish the entire site, it displays the wrong entry from the main blog, but the entries from the feeder blogs are for the correct category.
I've checked the query in phpmyadmin, debugged and can't find anything wrong. And it works fine when I only publish the main index.
I've managed to learn how to write queries on my own, but I don't know enough about the inner workings of MySQL or MT to figure out why it might be doing this.
Any help at all would be GREATLY appreciated!!
Aaron
The site: http://www.inwordexperience.com
The queries:
(Select most recently created category from main blog whose custom field "preview" is not selected.)
<MTSQLCategories query="select distinct category_id from mt_entry, mt_placement, mt_category, mt_entry_meta where (placement_category_id = category_id) and (placement_entry_id = entry_id) and (entry_id=entry_meta_entry_id) and (entry_meta_type='field.preview') and (entry_meta_vinteger_idx='0') and (category_blog_id=1) order by category_id desc limit 1">
(Select entry from main blog assigned category in context whose custom field "menu_item" equals 'None'.)
<MTSQLEntries query="select distinct entry_id from mt_entry, mt_placement, mt_category, mt_entry_meta where (category_label='[MTCategoryLabel]') and (placement_category_id = category_id) and (placement_entry_id = entry_id) and (entry_id=entry_meta_entry_id) and (entry_meta_type='field.menu_item') and (entry_meta_vchar_idx='None') and (category_blog_id=1) limit 1">
(Display Category in context - this always comes out right)
<$MTCategoryLabel$>
(Display entry assigned category in context - if entire site has been published, this part comes out wrong even though MTCategoryLabel displays the correct category.)
<$mt:Include module="Entry Summary"$>
</MTSQLEntries>
(Select entries from feeder blogs assigned to category in context.)
<MTSQLEntries query="select distinct entry_id from mt_entry, mt_placement, mt_category, mt_entry_meta where (category_label='[MTCategoryLabel]') and (placement_category_id=category_id) and (placement_entry_id=entry_id) and (entry_id=entry_meta_entry_id) and ((entry_meta_vchar_idx='None') or (entry_meta_vinteger_idx=0)) and (entry_blog_id != 1) and entry_status=2 order by entry_created_on desc" unfiltered="1">
(Display entries - this part always comes out right)
<$mt:Include module="Entry Summary"$>
</MTSQLEntries>
</MTSQLCategories>