How to use a value in WHERE clause from a comma separated string in a MySQL Table? -


how records table contains 24 deptid. i've added table structure. sql query id , name contains 24 deptid?

users: ------ id  name    deptid --- -----   ------- 1   balaji  1,136,12,53,48,2,153,45,78,53,10,3,143,53,46,49 2   scott   24,90,120 3   balraj  43,9,24,901 

we can use find_in_set function in mysql.

$deptid="24"; 

query is

select * users find_in_set('$deptid', deptid); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -