Avatar of APD Toronto
APD Toronto
Flag for Canada asked on

Filtering User Input

Hi Experts,

I have a textarea that the user needs to provide comments for a varchar(4000) MySQL field.

Using PHP, how can I filter(or better - escape) malicious or even naive input like a semicolon in a sentence.

For my particular scenario I cannot use any binding (at least I don't think I can), because I am updating up to 50 records with the same comment.

Actually, I know I can bind within my loop, but that would mean hitting the database up to 50 times
PHPMySQL Server

Avatar of undefined
Last Comment
APD Toronto

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
hielo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Marco Gasi

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Ray Paseur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
APD Toronto

ASKER
This actually needs to settle up to 50 invoices that the user identifies via checkbox.  

I forgot about using WHERE IN, which will make it possible for me to use binding.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23