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

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -