php - Mysql select where contains -


i have social networking site in process of constructing. users can follow each other , adds name list of followers. need scan list session username cookie choose statuses (posts) display. in sql recordset, have code:

select * statuses followedby contains '". $_session['mm_username']."'  

but brings error

you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'contains 'usernamecookie'' @ line 1

try this:

select * statuses followedby '%". $_session['mm_username']."%'  

like clause used string matching.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -