select distinct threads.id, threads.name, threads.readonly, threads.active, threads.forumidfk, threads.useridfk, threads.author, threads.datecreated, forums.name as forum, threads.author as username, threads.sticky, threads.views, conferences.name as conference, conferences.id as conferenceid, threads.lastpost, threads.msgcount as messagecount from (threads inner join forums on threads.forumidfk = forums.id) inner join conferences on forums.conferenceidfk = conferences.id where 1=1 <cfif arguments.bActiveOnly> and threads.active = 1 </cfif> <cfif isDefined("arguments.forumid")> and threads.forumidfk = <cfqueryparam value="#arguments.forumid#" cfsqltype="CF_SQL_VARCHAR" maxlength="35"> </cfif>
====================================== ... as it is now it works fine but I need to add the following condition : <cfif isDefined("arguments.testOnly") and arguments.testOnly IS 1> and users.testOnly = <cfqueryparam value="#arguments.testOnly#" cfsqltype="CF_SQL_SMALLINT"> </cfif> please help with the [select] and [from] (inner join?). Thank you very much. ===================================== order by threads.sticky desc, threads.lastpost desc -- View this message in context: http://www.nabble.com/help-a-new-with-query-...-tp16268102p16268102.html Sent from the MySQL - General mailing list archive at Nabble.com. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]