[PHP] Should I convert special characters before writing them to a table?

2001-10-04 Thread René Fournier
The reason I ask is, I'm having a problem processing rows in a table that contain single quotes (specifically, the PHP code I wrote that allows the user to duplicate a row doesn't work if the a field in the row has a single quote in it). Would it be better for me to strip out the single quotes

Re: [PHP] Should I convert special characters before writing them to a table?

2001-10-04 Thread Steve Werby
René Fournier [EMAIL PROTECTED] wrote: The reason I ask is, I'm having a problem processing rows in a table that contain single quotes (specifically, the PHP code I wrote that allows the user to duplicate a row doesn't work if the a field in the row has a single quote in it). Try

Re: [PHP] Should I convert special characters before writing them to a table?

2001-10-04 Thread Arpad Tamas
Try addslashes() before executing the query and stripslashes() when retrieving data from the db. See the online manual for more details. I think stripslashes() isn't needed when retrieving data from the db, it is needed only in the query string to protect special chars from interpretting

Re: [PHP] Should I convert special characters before writing them to a table?

2001-10-04 Thread Steve Werby
Arpad Tamas [EMAIL PROTECTED] wrote: I think stripslashes() isn't needed when retrieving data from the db, it is needed only in the query string to protect special chars from interpretting them as sql. I want to say this isn't true, but maybe that depends on the configuration of PHP (I'm