find array value from table in mysql

Suppose we have store data like 1,2,3,4

and find with single record like 1

than we can use select query

select * from table where id=1 .

when run query  your result set return 0 but if you can use select query with FIND_IN_SET than you will get result. like this query

select * from table where FIND_IN_SET(‘1’,id) // here id is field name.

Hope you help..cheers!.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s