Handling apostrophes, php and pgsql

Posted by running4surival on Stack Overflow See other posts from Stack Overflow or by running4surival
Published on 2010-05-27T14:03:09Z Indexed on 2010/05/27 14:51 UTC
Read the original article Hit count: 258

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about php

Related posts about sql