0

hi
i have below structure in my database table

id eve_id cat_id member add_date
1 Tel1 5 1,2,3,4,5 0000-00-00
2 Acc2 2 3 0000-00-00
3 For3 3 1 0000-00-00
4 Acc4 2 5 0000-00-00
5 Acc5 2 6 0000-00-00


now my query is as below

$memque="select * from tblevent where '5' in (member)";

but i am not getting result, i want id 1 and 4 in answer . please help me

thanks

5
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by simplypixie
0
$memque="select * from tblevent where member like '%5%' ";

OR

$filter="5";
$memque="select * from tblevent where member like '%{$filter}%' ";

Edited by urtrivedi: n/a

0

Or use a join

$memque="select * from tblevent left join member on member.member_id=tbleevent.member where member.member_id=5)";

This is assuming your member number in tblevent is the member id in your member table.

0
$memque="SELECT * FROM tblevent WHERE member = 5";

seems the obvious answer to me. I assume you're running the query and extracting the info thereafter with a 'while' loop?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.