Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Feb 23rd, 2018 67 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. DELIMITER $$
  2.  
  3. CREATE FUNCTION `fn_getparam`(param varchar(55), url varchar(2048)) RETURNS varchar(2048) CHARSET latin1 COLLATE latin1_general_cs
  4. BEGIN
  5.  
  6. declare val varchar(2048);
  7. declare _param varchar(60) DEFAULT CONCAT(param,'=');
  8.  
  9. select
  10. case
  11.     when locate(concat('&',_param), url) > 0
  12.         then right(url, length(url) - (locate(concat('&',_param),url)+length(concat('&',_param))-1))
  13.     when locate(concat('?',_param), url) > 0
  14.         then right(url, length(url) - (locate(concat('?',_param),url)+length(concat('?',_param))-1))
  15.     when locate(concat('#',_param), url) > 0
  16.         then right(url, length(url) - (locate(concat('#',_param),url)+length(concat('#',_param))-1))
  17.     when locate(_param,url) > 0
  18.         then right(url, length(url) - (locate(_param,url)+length(_param)-1) )
  19. else null
  20. end
  21. into val;
  22.  
  23. set val = replace(replace(left(val, locate('&',concat(val,'&'))-1),'%20',' '),'+',' ');
  24.  
  25. RETURN val;
  26.  
  27. END $$
  28.  
  29. DELIMITER ;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top