For example :
I have a table name "TEST" and then the value
name | attribute |
A | B |
A | C |
A | D |
if use php
$query = "select * from TEST";
and then i want the code like this
$query.remove(attribute,B) ; -> CODE
like this(i know this is wrong, i just wanna the similar code like that)
I really need that code for my project
Edit: Actually this is my real code:
$query ="SELECT * FROM news_feed
JOIN friend_list
WHERE (friend_list.cek='Friend' AND news_feed.emailFrom = friend_list.emailTo AND friend_list.emailFrom = '$email')
OR (news_feed.emailFrom = friend_list.emailTo AND news_feed.emailFrom = '$email')
ORDER BY news_feed.tgl desc limit 0,10";
As you can see the $email is the session that runs as the user email and if my friends was 3, then it will create 3 of $email inside the query which is duplicated.
WHERE attribute != 'B'
. – Rikesh Jun 12 at 7:20