homepage Welcome to WebmasterWorld Guest from 54.205.254.108
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
  changes to  
jean123456




msg:3849019
 7:53 pm on Feb 13, 2009 (gmt 0)

I don't know if this is a php or a mysql question.

The mysql variable contains:

    This is an indented item.

When it is retreived and output to the page,   is changed to  

with the result that the page is rendered as:

    This is an indented item.

instead of as

This is an indented item.

 

jean123456




msg:3849024
 7:54 pm on Feb 13, 2009 (gmt 0)

That is
[four blank spaces]This is an indented item.

jean123456




msg:3849030
 8:01 pm on Feb 13, 2009 (gmt 0)

It's hard to ask questions using these codes. The page contains:

    This is an indented item.

instead of

    This is an indented item.

So the page renders with the actual & n b s p ; characters instead of using blank spaces.

I notices the database had no collation for this column. I tried changing the collation utf8-unicode-ci then I re-updated the column value but the result was still the same. I also tried ascii-general-ci.

Perhaps the problem isn't in mysql but in the php that is retrieving it?

I'm at a new host with a new small mini cms module with an impatient client who just wants to get rid of the   characters.

(Of course, it's doing the same with dashes etc. The input is from html generated by openoffice.)

coopster




msg:3849086
 9:20 pm on Feb 13, 2009 (gmt 0)

Perhaps the problem isn't in mysql but in the php that is retrieving it?

Or the programmer that coded the PHP :)
If the data in the database table column is already HTML, which it is according to your description, then you seemingly telling PHP somewhere in there to html entity encode the text before displaying it. If you are using htmlentities [php.net], htmlspecialchars [php.net] or something along those lines you are converting the data before it gets sent to the browser which in turn will not render the HTML as you prefer because you have converted the entities. Search your code after the data has been retrieved to see if you can find either of those functions or something similar that is converting your html entities.

jean123456




msg:3849107
 9:41 pm on Feb 13, 2009 (gmt 0)

THANK YOU

htmlspecialcharacters was the culprit

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved