Returning querys with no results, help?
Hi I am trying to query my database to show what posts an individual user has created, which does work, but if a user has submitted no posts then I cannot get my CFIF statement to display some text, I think the codes right I just cannot figure out why it wont work, any help appreciated.
Heres the code:
<cfquery name="q2" datasource="datasource">
select * from blogentries where blogauthor = '#q1.user_firstname# #q1.user_surname#' order by [ID] desc
</cfquery>
<img src="images/yourposts.jpg" /><br />
<h2><u>News items written by you.</u></h2>
<cfoutput query="q2">
<cfif q2.RecordCount is '0'>
You have no posts at the current moment in time.
<cfelse>
<a href="blogs.cfm?id=#id#"><h2>#blogtitle#</h2></a><span class="orangebit">#submissiondate#</span>
<p>#left(blogdescription,200)#</p>
<hr />
</cfif>
Anyone know where i'm going wrong?
Thanks.
