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
Post a Comment