For my forms, I'm using pg_escape_string on every field before I insert them into the database. So I get something like firstname='O''reilly'. But when I try to print that out, I get O''reily, 2 apostrophes. Shouldn't it only 1 apostrophe, O'reilly?
This isnt a debugging problem, im just wondering if you have firstname='O''reilly', how do you print that so it is just O'reilly instead of O''reilly?