d3trax
9/10/2012 - 1:24 PM

mysql explode

mysql explode

if(INSTR({string_or_var}, '-'), (REPLACE( SUBSTRING( SUBSTRING_INDEX(  {string_or_var},  '-', 1 ) ,
LENGTH( SUBSTRING_INDEX(  {string_or_var},  {string_or_var}, 1 -1 ) ) +1 ) , '-',  '' )), '')

if(INSTR({string_or_var}, '-'), (REPLACE( SUBSTRING( SUBSTRING_INDEX(  {string_or_var},  '-', 2 ) ,
LENGTH( SUBSTRING_INDEX(  {string_or_var},  {string_or_var}, 2 -1 ) ) +1 ) , '-',  '' )), '')