php - MySQL Error:Got error 'empty (sub)expression' from regexp -


i running sql query containing following bit of code:

if(oa.affiliatetrack regexp '|mb[1-6]', ((ol.item_price_exvat * oloq.oq_item_qty) * 0.08) *1.20, ((ol.item_price_exvat * oloq.oq_item_qty) * 0.06) *1.20) original_commission 

when run on mysql works fine. when move linux server automatically runs script through php returns me error:

mysql error:got error 'empty (sub)expression' regexp

what mean? , how avoid it?

in code string regexp '|mb[1-6]' has symbol |

that symbol work or searching variants, |mb[1-6] has next searching variants:

  • - empty string (this generate error in case)
  • mb1
  • mb2
  • mb3
  • mb4
  • mb5
  • mb6

if need | text part in searching string use \|


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

1111. appearing after print sequence - php -