close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

nested recordset REGEXP not matching strings containing special characters

Thread began 2/03/2022 9:57 am by Mags | Last modified 2/03/2022 4:50 pm by Ray Borduin | 200 views | 4 replies |

Mags

nested recordset REGEXP not matching strings containing special characters

Hi Ray, hope you can advise on an issue I'm having with a nested recordset - have been Googling all afternoon and can't find anything that will solve this. The recordsets contain course names, and the nested recordset is matching on these course names using a REGEXP. It works fine, except if the course name contains special characters i.e. "Testing & Certification (T&C)" - in that case it doesn't find a match. This is the current nested recordset which sits within the rsTests repeat region:

<?php
$WADACPD = new WA_MySQLi_RS("WADACPD",$connection,1000);
$WADACPD->setQuery("SELECT CPD.CPD_ID, CPD.User_ID, CPD.Course_name, CPD.`Date` FROM CPD WHERE CPD.User_ID = ? AND CPD.Course_name REGEXP ? ORDER BY CPD.`Date` DESC");
$WADACPD->bindParam("i", "".$_SESSION['CPD_ID'] ."", "-1"); //colname
$WADACPD->bindParam("s", "".($rsTests->getColumnVal("Title")) ."", "-1"); //paramTest
$WADACPD->execute();?>

All the 'solutions' I've found so far either return all or no records. Is there a way I can get the REGEXP to also find course names which contain special characters?

Sign in to reply to this post

Ray BorduinWebAssist

Try using:

($rsTests->getColumnVal("Title",false))

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

Mags

Have tried that and it made no difference unfortunately.

Sign in to reply to this post

Ray BorduinWebAssist

You probably need to escape special characters, try:

php:
$WADACPD->bindParam("s", "".(preg_quote($rsTests->getColumnVal("Title",false))) ."", "-1"); //paramTest
Sign in to reply to this post
Did this help? Tips are appreciated...

Mags

Yes, I think that's worked! Will get some users to test as well but it's now showing my test cases - thank you!

Sign in to reply to this post

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...