Prepared Statement question and help needed

I have an article database and want to filter the search for one or more search terms are entered in a text field. Multiple search words are separated by spaces. For example, “Canon Laser Printer” or “1TB HDD”

I have this programmed as a prepared statement function. As a second step, I would like to also search in multiple columns, like eg “description, ean, vendor number”

Is this even make sense to make this as prepared statement?

Start searching:

productsRS = App.myDB.FindProducts("description", searchText)

This is the Prepared Statement Search Funktion (MySQL):

[code]Function FindProducts(dbColumn As String, Optional searchName As String) As RecordSet
Dim sql As String = “SELECT * FROM articles WHERE " + dbColumn + " LIKE ?”
Dim filter As String
Dim sArray(-1) As String

sArray = Split(searchName, " ")

If UBound(sArray) > 0 Then

For i As Integer = 1 to UBound(sArray)
  filter = filter + " AND " + dbColumn +  " LIKE ?"

sql = sql + filter

End If

System.DebugLog sql

Dim stmt As PreparedSQLStatement = Self.Prepare(sql)

For i As Integer = 0 to UBound(sArray)
stmt.BindType(i, MySQLPreparedStatement.MYSQL_TYPE_STRING)
stmt.Bind(i, “%”+sArray(i)+"%")

Dim rs As RecordSet = stmt.SQLSelect

Return rs

End Function[/code]

If you’re using a version of mySQL that supports it (3.23.23 or newer), you might want to investigate using Full Text Search. This would allow you to find “Laser Printer Cannon” and “HDD 1TB” as well as the examples given.

However, only whole words are found, no fragments.