Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 21st, 2013  |  syntax: None  |  size: 1.18 KB  |  views: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. CREATE PROCEDURE `sp_location_selectAllByTermAutoComplete`(
  2. IN _term VARCHAR(99))
  3. BEGIN
  4.  
  5.     SELECT
  6.         `title` AS `value`,
  7.         `keyword` AS `label`,
  8.         `city_id`,
  9.         `id` AS `locationtitle_id`
  10.     FROM `locationtitle`
  11.     WHERE
  12.         MATCH(`keyword`) AGAINST(_term  IN BOOLEAN MODE)
  13.     ORDER BY MATCH(`keyword`) AGAINST(_term  IN BOOLEAN MODE) DESC
  14.     LIMIT 0, 10
  15. ;END//
  16.        
  17. SELECT
  18.         `title` AS `value`,
  19.         `keyword` AS `label`,
  20.         `city_id`,
  21.         `id` AS `locationtitle_id`
  22.     FROM `locationtitle`
  23.     WHERE
  24.         MATCH(`keyword`) AGAINST('+NEW*'  IN BOOLEAN MODE)
  25.     ORDER BY MATCH(`keyword`) AGAINST('+NEW*'  IN BOOLEAN MODE) DESC
  26.     LIMIT 0, 10
  27.        
  28. CREATE PROCEDURE `sp_location_selectAllByTermAutoComplete`(
  29. IN _term VARCHAR(99))
  30. BEGIN
  31.  
  32.     SELECT
  33.         _term as my_param,
  34.         MATCH(`keyword`) AGAINST(_term  IN BOOLEAN MODE) as my_param_result,
  35.         `title` AS `value`,
  36.         `keyword` AS `label`,
  37.         `city_id`,
  38.         `id` AS `locationtitle_id`
  39.     FROM `locationtitle`
  40.     WHERE
  41.         MATCH(`keyword`) AGAINST('+NEW*'  IN BOOLEAN MODE)
  42.     ORDER BY MATCH(`keyword`) AGAINST('+NEW*'  IN BOOLEAN MODE) DESC
  43.     LIMIT 0, 10
  44. ;END//
clone this paste RAW Paste Data