Hi Everyone:
I'm trying to code an advanced search engine, where the user is able to enter specify field names and then the keywords to search that field on, they can then specify specific some boolean logic operators(AND, OR). They can do this for a maximum of 3 levels, please see attachment.
I have run some test queries and if I fill in every available field it seems to work, but if I leave some fields empty I get the this error or something like it- mysql result-not a valid-mysql query result.
I presume this because the sql query is expecting a value in the empty field, is there anyway I can get the compiler to ignore the empty fields and simply construct and run the query on the fields that are filled in.
Perhaps something like this:
if $searchid2 = "" {
searchid2 = 'NULL';
}
Any help offered will be greatly appreciated.
Christian