I a trying to check if a member is online and then output the member info (contained in a channel entry) in a paginated grid pattern of 12 to a page.
The following code works ok without the query but with the query I get one member output per page:
{exp:channel:entries channel="zoo_visitor" search_id="{segment_2}" group_id="7|8" search:show_hide="show" search:member_photo="not IS_EMPTY" paginate="bottom" limit="12"}
{paginate}{clear}<div class="messagebar">{if previous_page}<a href="http://{auto_path}"> «Previous Page</a> {/if}
{if next_page}<a href="http://{auto_path}">Next Page »</a>{/if} <span class="grid-right">{pagination_links}</span></div>{clear}{pad}{/paginate}
{exp:query sql="SELECT member_id FROM exp_sessions WHERE member_id = '{member_id}' LIMIT 1"} {if member_id}
<div class="{switch='grid-item|grid-item|grid-item|grid-item last'}">
<!-- Entry content goes here -->
</div> {/if}{/exp:query}
{/exp:channel:entries}