0

I am inserting a couple of variables using mysql_query. Not too long ago it all worked out flawlessly, but now some variables don't seem to get in the phpmyadmin database when there's a special character like á in the string. It simply won't display anything in the correct column in phpmyadmin. The other variables are stored correctly though.

All the collations in the database are utf8_general_ci. I've tried changing it to utf8_unicode_ci. This caused the string 'á' to display with weird characters like á. Some other things I've tried:

Adding <meta charset="UTF-8">

Adding <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

I couldn't find any solution. If there's anything you guys can come up with, I'd like to hear it.

Thanks in advance.

sander
  • 1,340
  • 1
  • 10
  • 20
  • I just finished writing my working answer to your question "Recursive function for finding mathematical expressions to yield answer" but it is now deleted somehow. Can you post it again so I can post my answer for you? – blhsing Sep 28 '18 at 13:16
  • @blhsing I had to remove it because appearently they put the question on hold. No idea why, but it was only getting voted down. Do you mind sending me the code? I would really appreciate it! – sander Sep 28 '18 at 21:05
  • I see. It was voted down because you did not provide any code showing your effort, but generally if someone already provides a valid answer people then wouldn't be voting it down. I do prefer to keep my answers public, so would you try posting your question again, and I'll quickly post my answer? I'll be in front of my computer in the next few hours. It's weekend so there are a lot less people looking and voting and so chances are I'll be able to post my answer before enough people vote it down. Just write a message to me here after you post. – blhsing Sep 29 '18 at 00:42
  • For your convenience here's your question: Say we have the following list: [5, 3, 4, 8] And we were supposed to find the right mathematical expressions used to yield the answer 16, using only: +, -, * and /. In each step you only use the two most-left terms. All aditional operator precedence rules are disobeyed. How would a recursive function look like to solve this, having as output: ['+', '/', '*'] (explanation: 5 + 3 = 8, 8 / 4 = 2, 2 * 8 = 16)? – blhsing Sep 29 '18 at 00:48
  • By the way, it certainly would be nice if you include any bit of code you may have had before you decided to ask for help. But again, it's okay by me if you don't. – blhsing Sep 29 '18 at 01:17

2 Answers2

1

&amp;#225; is what happens when you call htmlentities twice on an accented letter !

Possibly the data is mis-encoded on input; let's see SELECT col, HEX(col) FROM ... as discussed in here . Then see if the rest of that Q&A answers your situation.

Community
  • 1
  • 1
Rick James
  • 135,179
  • 13
  • 127
  • 222
-1
mysql_real_escape($yourvariable) 
Javaid Ahmad
  • 181
  • 1
  • 1
  • 7