[PHP-DB] PROBLEM IN INSERTING TEXT WITH SINGLE QUOTE

2001-04-22 Thread Jennifer Arcino Demeterio

Hello all,

I am having a problem in inserting text with apostrophe to mysql database.

When a user fills out a form field that includes an apostrophe ex. Jen's ,
the verify screen shows it as  Jen\'s and it 
is then input into the database as Jen\'s - automatically adding 
the backslash.  The problem is that when the record is pulled out of the MySQL 
database into my display script it also shows up as Jen\'s - with 
the backslash - but I want viewers to see it as Jen's - without the 
slash.  Then, if I modify the record and don't take out the slash, it adds 
an additional slash so I wind up with Jen\\'s.  

Can someone help me with my problem?

Thanks in advance,
Jen







Re: [PHP-DB] PROBLEM IN INSERTING TEXT WITH SINGLE QUOTE

2001-04-22 Thread Rasmus Lerdorf

 When a user fills out a form field that includes an apostrophe ex. Jen's ,
 the verify screen shows it as  Jen\'s and it

That's because magic_quotes_gpc is enabled in your php.ini file.  You can
turn this off if you wish, or simply do a stripslashes() on the string
you are displaying.

 is then input into the database as Jen\'s - automatically adding
 the backslash.

No, here you are confused.  Unless you are doing an addslashes() yourself,
it will go into MySQL correctly.

-Rasmus


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PROBLEM IN INSERTING TEXT WITH SINGLE QUOTE

2001-04-22 Thread Phil Jackson

Try stripslashes(fieldname) to "unescape" those slashes when retieving from DB

Phil J.


Jennifer Arcino Demeterio wrote:

 Hello all,

 I am having a problem in inserting text with apostrophe to mysql database.

 When a user fills out a form field that includes an apostrophe ex. Jen's ,
 the verify screen shows it as  Jen\'s and it
 is then input into the database as Jen\'s - automatically adding
 the backslash.  The problem is that when the record is pulled out of the MySQL
 database into my display script it also shows up as Jen\'s - with
 the backslash - but I want viewers to see it as Jen's - without the
 slash.  Then, if I modify the record and don't take out the slash, it adds
 an additional slash so I wind up with Jen\\'s.

 Can someone help me with my problem?

 Thanks in advance,
 Jen


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]