This topic is locked

apostrophes being doubled

9/4/2020 1:28:44 PM
PHPRunner General questions
S
Sidewinder author

Good afternoon, is PHPrunner adding escape for apostrophes automatically? i added code such as $lname = str_replace("'","''",$dpidata["MSOLSN"]); to escape an apostrophes in a name like "O'Brian". this would store in the SQL Server database as "O'Brian" now i noticed that the name is being stored as "O''Brian".
I had added the code $lname = str_replace("'","''",$dpidata["MSOLSN"]); some time back as when someone entered a name like "O'Brian" i would get a error.
Thanks in advance

Myr0n 9/4/2020



Good afternoon, is PHPrunner adding escape for apostrophes automatically? i added code such as $lname = str_replace("'","''",$dpidata["MSOLSN"]); to escape an apostrophes in a name like "O'Brian". this would store in the SQL Server database as "O'Brian" now i noticed that the name is being stored as "O''Brian".
I had added the code $lname = str_replace("'","''",$dpidata["MSOLSN"]); some time back as when someone entered a name like "O'Brian" i would get a error.
Thanks in advance


What is the Character set & collation of your database?

Sergey Kornilov admin 9/4/2020

If you use the built-in Add/Edit functionality PHPRunner will take care of apostrophes and other bad characters.