I have this query in a template. The idea is that it will embed an empty Safecracker form if an entry for that user doesn’t already exist, but it does not work. If there are no results, nothing happens. Not sure why. It does display an entry if one exists.
{exp:query sql="SELECT entry_id FROM exp_channel_titles WHERE channel_id = '18' AND author_id = '{member_id}'"}
{embed="dashboard/.profile" entry="{entry_id}"}
{if no_results}
No results.
{/if}
{/exp:query}