Re: Re[2]: [PHP] HTML in database

This is a discussion on Re: Re[2]: [PHP] HTML in database within the PHP General forums, part of the PHP Programming Forums category; I was still having the same problems even with PDO, but doing my own replace: $body = str_replace("'", "\&...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-05-2007
Bruce Cowin
 
Posts: n/a
Default Re: Re[2]: [PHP] HTML in database

I was still having the same problems even with PDO, but doing my own replace:

$body = str_replace("'", "\"", $body);

fixed the problem. Thanks again!


Regards,

Bruce

>>> Richard Davey <rich@corephp.co.uk> 5/07/2007 12:34:29 p.m. >>>

Hi Bruce,

Thursday, July 5, 2007, 1:26:01 AM, you wrote:

> Thanks. Sorry, I should have mentioned I'm using MS Sql Server and
> I don't see a mssql equivalent to that function.


MSSQL treats '' as an escaped ', not \' like MySQL does.

So you can't addslashes it. Perform your own ' to '' conversion.

Also check to see if you've got RUNTIME Magic Quotes on, because that
will auto-escape data (\'), which is pointless for MSSQL.

Cheers,

Rich
--
Zend Certified Engineer
http://www.corephp.co.uk

"Never trust a computer you can't throw out of a window"

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:46 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0