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

Kohana 2.3.4 ORM and Regex database method

By: a guest on Feb 22nd, 2012  |  syntax: None  |  size: 0.65 KB  |  views: 13  |  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. $prod_name = ORM::factory("product")->regex("prod_name", "^" . $searchArray[$i] . "$")->find_all();
  2.  
  3. $prod_name = ORM::factory("product")->regex("prod_name", "/b" . $searchArray[$i] . "/b")->find_all();
  4.  
  5. $prod_name = ORM::factory("product")->regex("prod_name", "/b" . $searchArray[$i] . "b/")->find_all();
  6.        
  7. $prod_name = ORM::factory("product")->like("prod_name",$searchArray[$i])->find_all();
  8.        
  9. $prod_name = ORM::factory("product")->like("prod_name",$searchArray[$i] . "%", FALSE)->find_all();
  10.        
  11. [[:<:]]shoe
  12.        
  13. shoe[[:>:]]
  14.        
  15. [[:<:]]shoe[[:>:]]
  16.        
  17. $prod_name = ORM::factory("product")->regex("prod_name", "[[:<:]]" . $searchArray[$i])->find_all();