Jump to content

Displaying special character...


elmas156

Recommended Posts

I'm having a problem that I didn't seem to have in the past... for some reason, it just popped up... or maybe I'm just noticing it.  Anyway, I this in a field in a mysql database:

 

"Here's a test."

 

When I query the database and echo the text to the page with this code:

 

$result = mysql_query("SELECT question FROM signin WHERE email = '$email'") or die (mysql_error());
$row = mysql_fetch_row($result);

$test = $row[0];

echo $test;

 

This is the result:

 

"Heres a test."

 

Any ideas on why the apostrophe is not being displayed and how to fix it?  I'm stumped.  Thanks for any help.

 

 

Link to comment
Share on other sites

I just found the problem!  I finally just broke down and rewrote the whole section of code and I realized that I was pulling info from the "signin" table when I should have been getting it from the "staff" table!  Basically, I was querying the wrong information.  Silly mistakes cost me so much time!  Thanks for your help.

Link to comment
Share on other sites

Haha... We all make them, some are just better at finding them than others.  The ones that I hate the most are the ones where there's not really any problem in the code, so you get no errors... just the wrong output, so you're left trying to trace your steps, usually to find that the only problem was yourself!  Funny how something works right when you do it right...

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.