Just wondering - does xPDO automatically escape data before performing a database operation? I can see the quote function that calls mysql_real_escape_string(), but just want to make sure it is called before an INSERT/UPDATE and that I don’t have to do it myself.
I’m having trouble inserting data with single quotes when I run the data through $modx->db->escape() myself, but it works fine if I don’t.
Thanks...
-
MODX Staff
- 10,725 Posts
Yes, PDO takes care of that automatically, as long as you are using prepared statements. Otherwise, use the quote() function from PDO if you want to include raw PHP values. All INSERTs and UPDATEs generated from working with objects in xPDO are automatically handled as well.
-
☆ A M B ☆
- 1,056 Posts
...I just a had a soothing warm feeling come over me...
-
☆ A M B ☆
- 24,524 Posts
Quote from: pixelchutes at Feb 16, 2007, 06:19 PM
...I just a had a soothing warm feeling come over me... 
Ah, yes. My youngest son had the same problem until he was 10 or 11; it turned out he was allergic to corn. Took him off corn (and anything with any corn in it, such as cornstarch in the baking powder or corn syrup as a sweetener) and his bed stayed dry!
-
MODX Staff
- 12,272 Posts
LOL ... what an unexpected setup!
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
☆ A M B ☆
- 24,524 Posts

Sorry... couldn’t resist
-
☆ A M B ☆
- 1,056 Posts