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
https://forums.phpfreaks.com/topic/231653-displaying-special-character/
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.

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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.