Actually, better use that link (above). Blogger is messing with the code below.
Usage:
1.
SELECT
HTML_UnEncode(firstname),HTML_UnEncode(lastname)
FROM
users;
01.
DELIMITER $$
02.
03.
DROP
FUNCTION
IF EXISTS `sourcedatabase`.`HTML_UnEncode`$$
04.
CREATE
DEFINER=`
user
`@`localhost`
FUNCTION
`HTML_UnEncode`(x
VARCHAR
(255))
RETURNS
varchar
(255) CHARSET latin1
05.
BEGIN
06.
07.
DECLARE
TextString
VARCHAR
(255) ;
08.
SET
TextString = x ;
09.
10.
#quotation mark
11.
IF INSTR( x ,
'"'
)
12.
THEN
SET
TextString =
REPLACE
(TextString,
'"'
,
'"'
) ;
13.
END
IF ;
14.
15.
#apostrophe
16.
IF INSTR( x ,
''
' )
17.
THEN SET TextString = REPLACE(TextString, '
''
,
'"'
) ;
18.
END
IF ;
19.
20.
#ampersand
21.
IF INSTR( x ,
'&'
)
22.
THEN
SET
TextString =
REPLACE
(TextString,
'&'
,
'&'
) ;
23.
END
IF ;
24.
25.
#less-than
26.
IF INSTR( x ,
'<'
)
27.
THEN
SET
TextString =
REPLACE
(TextString,
'<'
,
'<'
) ;
28.
END
IF ;
29.
30.
#greater-than
31.
IF INSTR( x ,
'>'
)
32.
THEN
SET
TextString =
REPLACE
(TextString,
'>'
,
'>'
) ;
33.
END
IF ;
34.
35.
#non-breaking
space
36.
IF INSTR( x ,
' '
)
37.
THEN
SET
TextString =
REPLACE
(TextString,
' '
,
' '
) ;
38.
END
IF ;
39.
40.
RETURN
TextString ;
41.
42.
END
$$
43.
44.
DELIMITER ;
Hello ,
ReplyDeleteI am Getting following Error..
Can you please help..
Thanks in advance
Error
SQL query:
DELIMITER $$ DROP FUNCTION IF EXISTS `sourcedatabase`.`HTML_UnEncode` $$ CREATE DEFINER = `user`@`localhost` FUNCTION `HTML_UnEncode` (
x VARCHAR( 255 )
) RETURNS varchar( 255 ) CHARSET latin1 BEGIN DECLARE TextString VARCHAR( 255 ) ;
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER $$
DROP FUNCTION IF EXISTS `sourcedatabase`.`HTML_UnEncode`$$
CREA' at line 1
30
ReplyDeletedown vote
accepted
There are two ways to fix this:
Execute the following in the MySQL console:
SET GLOBAL log_bin_trust_function_creators = 1;
Add the following to the mysql.ini configuration file:
log_bin_trust_function_creators = 1
and replace sourcedatabase with your db name and user with your username
#1582 - Incorrect parameter count in the call to native function 'INSTR'
ReplyDeleteTo link to a website from a picture in an email or forum, you should be able to use the editing buttons in the same way you link text. css forums
ReplyDeleteI saw a lot of website but I believe this one has got something special in it in it web design new york
ReplyDeleteHey there! Nice stuff, please keep me posted when you post something like this! web design new york
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteTaylor Lautner Workout Routine… By the way you might want to check out this cool site I found…… san fran design firms
ReplyDeleteI’ll right away grab your rss feed as I can not find your e-mail subscription link or e-newsletter service. Do you have any? Kindly let me know so that I could subscribe. Thanks. web design la
ReplyDeleteExtensively, now this article is truly the best using this crucial subject matter. My spouse and i harmonise collectively findings and tend to thirstily expect to be your primary one way upgrades. Explaining kudos won’t only always be an adequate amount of, on your wonderful purity inside your crafting articles. For certain i will easily catch an individual’s feed maintain up to date of the the latest. Enlightening job and far becoming successful for your small business trades! Please justification the actual deficient Everyday terms currently far from a few initial language. la web design
ReplyDeleteGood day” i am doing research right now and your blog really helped me” web design la
ReplyDeleteThese kinds of Search marketing boxes normally realistic, healthy and balanced as a result receive just about every customer service necessary for some product. Link Building Services converting websites
ReplyDeleteI got what you mean , regards for posting .Woh I am pleased to find this website through google. top web design agencies
ReplyDelete