Reputation: 2231
In my database I store some html code (from CKEditor), and I would like to be able to check these values in PhpMyAdmin.
There is one small problem : the HTML is written in french so there are a lot ar é: or other kind of html characters that make the values hard to read.
I know there are settings to avoid CKEditor replacing the characters with é:, but I do not want to change anything in the code or configuration tight now.
Is there any MySQL command that would allow to display the text correctly?
Note : doing a str_replace or kind is not wanted.
Edit : For exemple for an element stored as follow :
<div>
é:lé:phant
</div>
I would like to read in my result column :
<div>
éléphant
</div>
Upvotes: 2
Views: 653
Reputation: 12422
This is easily accomplished with phpMyAdmin's transformation feature.
My answer assumes you already have a properly configured phpMyAdmin Configuration Storage, if not you just have to create the tables by editing the file in examples/create_tables.sql
to set a username, database name, and password, then import that to your MySQL server. Edit config.inc.php to add the directives you can find listed beginning at http://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_pmadb .
Before:
Anyway, edit your table by going to the Structure tab.
Click the pencil icon/Change link for the column(s) containing the HTML entities.
On the resulting page, look for the "Browser display transformation" dropdown. One of the built in transformations is exactly what you're after: "Text/Plain: Formatted"
Click Save, then you can Browse the table and should see the transformed output.
After:
Upvotes: 0
Reputation: 6263
I'm afraid there is no way to do directly what you are asking for.
The best way I've found would be to create a function which decodes the text, and then use it in select statements:
mysql> SELECT HTML_UnEncode('Dr.Hübner');
+---------------------------------+
| HTML_UnEncode('Dr.Hübner') |
+---------------------------------+
| Dr.Hübner |
+---------------------------------+
Here is the link to that function:
http://forums.mysql.com/read.php?98,246527,246527
Upvotes: 3