How to escape single quote in SQL?

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
clphpmak
User
Posts: 26

How to escape single quote in SQL?

Post by clphpmak »

I'm using the Page_Unload in list page and insert some user date between table so it fills in First, Last, Email Address etc.

I have a variable

$FIRST_NAME = CurrentUserInfo("first_name");

And insert it into another table. The problem is if user enter something like Mark's or other single quotes.

I tried $FIRST_NAME = mysqli_real_escape_string($FIRST_NAME); did not work.

Is there something that PHPMaker can do to sanitize?

Thank you


mobhar
User
Posts: 11735

Post by mobhar »

There are some tricks to do it, you may Google "php escape single quote".


arbei
User
Posts: 9389

Post by arbei »

If you use v2024, you may simply use ORM.


Post Reply