This topic is locked
[SOLVED]

 Escape Bad Characters Upon Import

8/27/2018 4:53:53 AM
PHPRunner General questions
lefty author

Is there any way to escape characters before insert in import mode with phprunner? I have users who import VARCHAR fields for MYSQL table , but unfortunately their data has bad characters ( apostrophes , ' , " , . , && etc...) in some text fields which causes errors when executed on ADD/Edit page events with queries related to that field. I can use mysqli_real_escape_string in queries in my project but I have a huge project and don't want to have to change each query that has a string /test field ( MYSTORE/#1 or Fritz's or MYSTORE. MyStore & etc..) . I can use validation when they just add a new record ,but when import I can't stop them from adding thousands of records with unwanted characters in them . I am using all versions PHPrunner 9.7 , 9.8 and 10. Any ideas would be appreciated.

admin 8/27/2018

Doesn't really make much sense to me this way. PHPRunner escapes bad characters automatically during import. It is not possible for something to be inserted during import and cause an issue later on the Add page, unless you talking about something else.

lefty author 8/27/2018



Doesn't really make much sense to me this way. PHPRunner escapes bad characters automatically during import. It is not possible for something to be inserted during import and cause an issue later on the Add page, unless you talking about something else.


Notice the ' in first record , notice the period in 3rd record and notice the forward slash in the 6th record. If I use customer name in an event custom query like before record added or after record added I get error because of the bad characters. Am I missing something ? These records were imported with 9.8 . "edited" . Are you saying it escapes bad characters so it can import bad characters or are you saying the import get's rid of bad characters. I would assume it just ignores them and imports them as what I am getting.
Example 1st line of query $rs = CustomQuery("SELECT * FROM Customers WHERE custname=// syntax error right here on records with bad characters only //'".$values["custname"]."' AND CustomerID= " . $values["CustomerID"] . " ");
Can't reproduce in 9.8 only 9.7 . Guess this is solved with my new project . Strange. !