close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to modify this search?

Thread began 10/21/2020 11:42 am by LionsMane | Last modified 10/23/2020 12:35 pm by Ray Borduin | 19 views | 5 replies |

LionsMane

How to modify this search?

I have the following search code on a page using the webasssist recordset... but it seems to be case sensitive. How do I change this so that it doesn't care about case?

$Recordset1 = new WA_MySQLi_RS("Recordset1",$DNSTags_i,0);
if (isset($_REQUEST['search']) && !empty($_REQUEST['search'])) {
$columns = ['TagTitle'];

// look for exact search
$booleanSearch = NULL;
if ($_REQUEST['search'][0] === "\"" && substr($_REQUEST['search'], -1) === "\"")
$booleanSearch = "IN BOOLEAN MODE";

// map search to query
$Where = " WHERE MATCH(". implode(',', $columns) .") AGAINST (? $booleanSearch)";
$SQL = "SELECT * FROM TAGS" . "$Where";

// may need to be filtered
$Recordset1->bindParam('s', $_REQUEST['search']);
$Recordset1->setQuery($SQL);
} else {
$Tracks->setQuery("SELECT * FROM TAGS");
}
$Recordset1->execute();

Sign in to reply to this post

Ray BorduinWebAssist

This is done in the database using phpMyAdmin.

Go to the column you are searching and change the collation to something that ends with "_ci"... those stand for "case insensitive".

After that change all searches against that column will be case insensitive.

Sign in to reply to this post
Did this help? Tips are appreciated...

LionsMane

Collation

Interesting, it's already set to latin1_general_ci. Other thoughts?

Sign in to reply to this post

Ray BorduinWebAssist

What is set to latin1_general_ci? All of the columns in the search and the table?

Is your query running with: IN BOOLEAN MODE? I think that may be removing the case insensitivity. Try removing that and see if you get the same result.

Sign in to reply to this post
Did this help? Tips are appreciated...

LionsMane

Kind of worked

Yes, we were using a boolean qualifier.. removing that did fix the capitalization question, but now SOME search results are coming up, but not others. I'll look at records to try and see if I can see why, but it's a mystery. I can see the Title in the database with the words I'm searching on. The record is there but not coming up in the results. But another set of words for another record come up just fine. Shouldn't it work the same for all?

Sign in to reply to this post

Ray BorduinWebAssist

I would think so. I couldn't diagnose this without digging in and doing debugging.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...