php - how to use MySQL like for searching exact a value -


i have string stored table 'tbl_route' column named 'route_nos'.

the string looks 3,4,7,8,9,10,11,14,16,20

i searching 2 number whole string using mysql operator.

$nospos="1";  $qr=mysql_query("select * tbl_route routes_nos '% $nospos %'"); 

but when query executes returns rows. there no 1 present in string. found takes partial match of no present in 11 or 14 or 16. need exact search.. how possible?

use

$qr=mysql_query("select * tbl_route find_in_set($nospos, routes_nos) "); 

refer doc here


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -