insert into #variables.tableprefix#conferences(id,name,description,active,messages) values(, , , , 0 ) delete from #variables.tableprefix#conferences where id = delete from #variables.tableprefix#subscriptions where conferenceidfk = select id, name, description, active, messages, lastpost, lastpostuseridfk, lastpostcreated from #variables.tableprefix#conferences where id = select id, name, description, active, messages, lastpost, lastpostuseridfk, lastpostcreated from #variables.tableprefix#conferences order by name select * from ( select top 20 #variables.tableprefix#messages.title, #variables.tableprefix#threads.name as thread, #variables.tableprefix#messages.posted, #variables.tableprefix#users.username, #variables.tableprefix#messages.threadidfk as threadid, #variables.tableprefix#messages.body, #variables.tableprefix#threads.forumidfk, #variables.tableprefix#forums.conferenceidfk from #variables.tableprefix#messages, #variables.tableprefix#threads, #variables.tableprefix#users, #variables.tableprefix#forums where #variables.tableprefix#messages.threadidfk = #variables.tableprefix#threads.id and #variables.tableprefix#messages.useridfk = #variables.tableprefix#users.id and #variables.tableprefix#threads.forumidfk = #variables.tableprefix#forums.id and #variables.tableprefix#forums.conferenceidfk = order by #variables.tableprefix#messages.posted desc limit 20 ) where rownum <= 20 update #variables.tableprefix#conferences set name = , description = , active = where id = select id, name, description from #variables.tableprefix#conferences where active = 1 and ( (name like or description like '%#aTerms[x]#%') #joiner# name like or description like '%#arguments.searchTerms#%' ) update #variables.tableprefix#conferences set lastpost = , lastpostuseridfk = , lastpostcreated = , messages = messages + 1 where id = update #variables.tableprefix#conferences set lastpost = , lastpostuseridfk = , lastpostcreated = , messages = where id = update #variables.tableprefix#conferences set lastpost = , lastpostuseridfk = , lastpostcreated = , messages = where id =