Skip to content

Instantly share code, notes, and snippets.

@kartick14
Last active June 30, 2021 15:19
Show Gist options
  • Save kartick14/fcaba1c82cc44eb9aeabb6268b1504b7 to your computer and use it in GitHub Desktop.
Save kartick14/fcaba1c82cc44eb9aeabb6268b1504b7 to your computer and use it in GitHub Desktop.
MySQL find exact substring from a string on DB table
$regxp = 'River';
$sql = "SELECT * FROM categories where catinclude RLIKE '(^|,)$regxp(,|\$)'";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment