Pre-save helper and apostrophes.

0

Hi. I've built a helper that will fill out field with something if it was left empty (e.g. "User hasn't entered anything"). The problem is in saving apostrophes in text, because SQL treats them (as far as i understand) as data begin/data end symbols (error alert box appears). How do i protect them from being recognized as language symbols?

update. I should always google it - looks like mysql-real-escape-string is the answer.

asked Aug 11 '10 at 1:33

Fike

208

edited Aug 11 '10 at 1:39

add comment
enter at least 15 characters

1 Answer

1

You can always use $data = pods_sanitize($data) on a value to ensure it's DB-ready.

answered Aug 11 '10 at 4:13

sc0ttkclark

2936

add comment
enter at least 15 characters