php - MYSQL: select from table where a string in a column matches? -


i'm trying select table column has string in matches criteria.

the normal way without string scenario this:

select * tablename hwere columnname='something' 

but lets columnname contains value this:

1,2,3,4 | someemail@yahoo.com 

and want select table columnname contains someemail@yahoo.com. so, how need go this?

i tried i'm 100% sure i'm doing wrong:

select substring_index(columnname,' | ',-1) tablename 

because don't see how where clause come in statement!

could please advise on issue?

you need use like

select * tablename columnname '%someemail@yahoo.com%' 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -