I have been working on a small simple project on localhost for a client, it's a comment system with a filter.
But whenever I try to add the filter, it seems to get stuck on it's first word. I've been trying to search the answer on Google for almost 8 hours now, before posting here.
It's a simple query, no complex things. But anyone got any suggestions? I tried the # and cfloop, cfoutput, cfquery, etc. but nothing seems to work.
<cfquery name = "communityFilter" datasource = "#DSN#">
SELECT *
FROM cms_filter
</cfquery>
<!-- Query van de filter -->
<cfif form.comment CONTAINS communityFilter.word>
Word gevonden!
<cfelseif NOT form.comment CONTAINS communityFilter.word>
Geen word gevonden, system werkt =)
</cfif>
The system needs to take the word that is not allowed out of the database, but it keeps saying Word found while it's not found.
When you refer to a query result, you should specify the row number like this:
If you don't you get the value from the first row. That's what is happening to you. While the comment might contain a bad word, you are not looking at all the available bad words. I suggest something like this.