Jump to content

please help me with output problem


littlepeg

Recommended Posts

:) Hi everybody. I am a  new learner for php & MySQL and have one easy question would like to ask for advice.

  How can I store content in the database when they have some special symbols. For example, one thing I need to store is time: between 12:00am-15:00pm. when I output it using php, it becomes like 12:00am?15:00pm. In addition, the other one is "company's", and this output became company?s.

  Any help would be grately and appreciated.  :)

Link to comment
Share on other sites

are those quoes and dashes from a MS product?

 

if they were regular html characters, they should store fine, but if the were of the "smart" variety, the browser would have trouble displaying them and mysql wouldnt understand them either.

 

one you figure that out, use htmlentities and mysql_real_escape_string before storing data

Link to comment
Share on other sites

Hi, thank you for your reply. My situation is that I stored some web content within a database, and then use php code to display them on the website. So would you please tell me that how do I use this htmlentities($string, ENT_QUOTES)?  :)

 

Link to comment
Share on other sites

htmlentities just changes troublesome characters, into their html counterparts... ' -->' " -->" @ -->& and the likes :-) just put that into where you enter stuff into the database, then, everyone's happy... :D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.