Syntax Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DNS
Forum Newbie
Posts: 2
Joined: Wed May 05, 2010 1:34 pm

Syntax Help

Post by DNS »

I have a functional open source php proposal software that we moved from a PHP 4.3.8 - Apache 2.0.50 - MySQL 4.0.20 box to a PHP 5.2.6.6 - Apache 2.2 - MySQL 5.051b box.
After the move we have started to notice that data is being returned with \ character before any ' or '' (single or double quotes). So like the row data of Joe O'brien now says Joe O\'Brien. Or if it's a measurement like 3 1/8" it now says 3 1/8\" when the data is pulled from the SQL database.
When I look at the actual data/text that is in the SQL table there are no \'s in the data. It reads properly.

Does anyone have a place to start looking for me? I've scoured the code but i'm not a php master at this point and I feel that this is something in the code. Possibly because it was written for an older version of PHP. The application seems to work just fine otherwise on the new system. It's just this \ that's showing up in the pages.

Any input would be much appreciated.
Thank you!
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: Syntax Help

Post by flying_circus »

look into "magic quotes"

It was an idea to escape characters automatically that have special meaning to PHP.
DNS
Forum Newbie
Posts: 2
Joined: Wed May 05, 2010 1:34 pm

Re: Syntax Help

Post by DNS »

Thanks for the quick response!
I modified the magic quotes area in my php.ini and turned all off.
I'm hoping this doesnt mess with any of my other sites. But it seems to have fixed the problems here.
thanks for your help!
Post Reply